basic damage mechanics for enemies
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user