ball now more consistently collides with arbitrary objects and bounces off them appropriately

This commit is contained in:
2024-07-23 20:07:13 +02:00
parent 3fea3c89ed
commit 091d957d26
7 changed files with 147 additions and 102 deletions
+19
View File
@@ -0,0 +1,19 @@
extends Sprite2D
class_name Block
@export var health: int = 1
func _ready():
_update_text()
func _update_text():
$Label.text = "%s" % health
func take_damage(damage):
health -= damage
_update_text()
if health < 0:
die()
func die():
self.queue_free()