basic damage mechanics for enemies

This commit is contained in:
Medenos
2023-01-14 23:05:08 -05:00
parent 4412fd21ea
commit 1d5435b0b5
7 changed files with 31 additions and 26 deletions

View File

@@ -18,3 +18,8 @@ func launch(direction):
func _on_life_timer_timeout():
queue_free();
func _on_body_entered(body):
if body.is_in_group("enemies"):
body.take_damage(DAMAGE);

View File

@@ -18,4 +18,5 @@ shape = SubResource("RectangleShape2D_pp7ve")
[node name="LifeTimer" type="Timer" parent="."]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="timeout" from="LifeTimer" to="." method="_on_life_timer_timeout"]