Skip to content

Commit

Permalink
Update physics_introduction.rst
Browse files Browse the repository at this point in the history
Corrected decimal calculation for layers
  • Loading branch information
balloonpopper authored and Calinou committed Aug 3, 2020
1 parent 75f0a84 commit d7e02b4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions classes/class_clippedcamera.rst
Expand Up @@ -218,3 +218,4 @@ Removes a collision exception with the specified :ref:`RID<class_RID>`.
Sets the specified bit index to the ``value``.

**Note:** Bit indices range from 0-19.

1 change: 1 addition & 0 deletions classes/class_raycast.rst
Expand Up @@ -290,3 +290,4 @@ Removes a collision exception so the ray does report collisions with the specifi
Sets the bit index passed to the ``value`` passed.

**Note:** Bit indexes range from 0-19.

1 change: 1 addition & 0 deletions classes/class_raycast2d.rst
Expand Up @@ -284,3 +284,4 @@ Removes a collision exception so the ray does report collisions with the specifi
- void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**

Sets or clears individual bits on the collision mask. This makes selecting the areas scanned easier.

1 change: 1 addition & 0 deletions classes/class_tilemap.rst
Expand Up @@ -690,3 +690,4 @@ Updates the tile map's quadrants, allowing things such as navigation and collisi
- :ref:`Vector2<class_Vector2>` **world_to_map** **(** :ref:`Vector2<class_Vector2>` world_position **)** const

Returns the tilemap (grid-based) coordinates corresponding to the given local position.

5 changes: 3 additions & 2 deletions tutorials/physics/physics_introduction.rst
Expand Up @@ -163,8 +163,9 @@ would be as follows:
0x000d
# (This value can be shortened to 0xd)

# Decimal - Raise each layer to be enabled (1, 3, and 4) to the power of 2 and add all the results together.
(1^2) + (3^2) + (4^2) = 13
# Decimal - Add the results of 2 to the power of (layer be enabled-1).
# (2^(1-1)) + (2^(3-1)) + (2^(4-1)) = 1 + 4 + 8 = 13
pow(2, 1) + pow(2, 3) + pow(2, 4)


Area2D
Expand Down

0 comments on commit d7e02b4

Please sign in to comment.