Skip to content

Commit e40f143

Browse files
authored
Merge pull request #7288 from kkoang/patch-6
2 parents d354e42 + 7f6a408 commit e40f143

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tutorials/physics/physics_introduction.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Collision layers and masks
114114
One of the most powerful, but frequently misunderstood, collision features
115115
is the collision layer system. This system allows you to build up complex
116116
interactions between a variety of objects. The key concepts are **layers**
117-
and **masks**. Each ``CollisionObject2D`` has 20 different physics layers
117+
and **masks**. Each ``CollisionObject2D`` has 32 different physics layers
118118
it can interact with.
119119

120120
Let's look at each of the properties in turn:
@@ -168,8 +168,8 @@ would be as follows::
168168
# Example: Setting mask value for enabling layers 1, 3 and 4
169169

170170
# Binary - set the bit corresponding to the layers you want to enable (1, 3, and 4) to 1, set all other bits to 0.
171-
# Note: Layer 20 is the first bit, layer 1 is the last. The mask for layers 4,3 and 1 is therefore
172-
0b00000000000000001101
171+
# Note: Layer 32 is the first bit, layer 1 is the last. The mask for layers 4,3 and 1 is therefore
172+
0b10000000_00000000_00000000_00001101
173173
# (This can be shortened to 0b1101)
174174

175175
# Hexadecimal equivalent (1101 binary converted to hexadecimal)
@@ -368,7 +368,7 @@ occurred:
368368
func _physics_process(delta):
369369
var collision_info = move_and_collide(velocity * delta)
370370
if collision_info:
371-
var collision_point = collision_info.position
371+
var collision_point = collision_info.get_position()
372372

373373
.. code-tab:: csharp
374374

@@ -400,7 +400,7 @@ Or to bounce off of the colliding object:
400400
func _physics_process(delta):
401401
var collision_info = move_and_collide(velocity * delta)
402402
if collision_info:
403-
velocity = velocity.bounce(collision_info.normal)
403+
velocity = velocity.bounce(collision_info.get_normal())
404404

405405
.. code-tab:: csharp
406406

0 commit comments

Comments
 (0)