mirror of
https://github.com/godotengine/godot.git
synced 2025-02-16 07:40:36 +00:00
Updated tutorial_physics_2d (markdown)
parent
29520de8fd
commit
894856ebfe
@ -30,5 +30,15 @@ var b = RectangleShape2D.new()
|
||||
b.set_extents(Vector2(20,10))
|
||||
```
|
||||
|
||||
The main use for shapes is checking collision/intersection and getting resolution information. This is done easily with the build functions like this:
|
||||
|
||||
```python
|
||||
|
||||
#check if there is a collision between two shapes, each with a transform
|
||||
if b.collide(b_xform,a,a_xform):
|
||||
print("OMG Collision!")
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user