diff options
| author | freddie-a <57713959+freddie-a@users.noreply.github.com> | 2022-10-29 22:45:55 +0100 |
|---|---|---|
| committer | freddie-a <57713959+freddie-a@users.noreply.github.com> | 2022-10-29 22:45:55 +0100 |
| commit | 136c6918c7d9f3ebe12c4535c438a2c67f01c110 (patch) | |
| tree | 66360dea71d9c02b2d2f8d864e6ee0448c7b6e0a /Bullet.gd | |
| parent | a4ac6fe79a37824f3f720f4a3c468172461f70d7 (diff) | |
Add bullet collisions
Diffstat (limited to 'Bullet.gd')
| -rw-r--r-- | Bullet.gd | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -13,7 +13,12 @@ func _physics_process(delta): velocity = global_position.direction_to(target) * speed shot = true velocity = move_and_slide(velocity) - + for i in get_slide_count(): + var collision = get_slide_collision(i) + if collision.collider: + collision.collider.free() + if velocity == Vector2(0.0, 0.0): + queue_free() |
