From 5fb367e0829d8f3616b5ccd5b4a0cd1dbaaef428 Mon Sep 17 00:00:00 2001 From: OddlyTimbot Date: Mon, 6 Jul 2026 12:30:43 -0400 Subject: [PATCH] finishing rockets --- scenes/rocket.tscn | 2 ++ scripts/game.gd | 4 ++++ scripts/scene_manager.gd | 1 + 3 files changed, 7 insertions(+) diff --git a/scenes/rocket.tscn b/scenes/rocket.tscn index 5458bf6..a26d89d 100644 --- a/scenes/rocket.tscn +++ b/scenes/rocket.tscn @@ -6,6 +6,8 @@ size = Vector2(12, 4) [node name="Rocket" type="RigidBody2D" unique_id=2026133878] +contact_monitor = true +max_contacts_reported = 2 script = ExtResource("1_3341w") [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1980926328] diff --git a/scripts/game.gd b/scripts/game.gd index f88c401..539a0f0 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -49,3 +49,7 @@ func crateTotal(howmany): func bulletDamage(body, _bullet)->void: if body.is_in_group("shootable"): destroySignal.emit(body) +func rocketDamage(body, rocket)->void: + if body.is_in_group("shootable"): + print("Rocket strikes target!") + destroySignal.emit(body) diff --git a/scripts/scene_manager.gd b/scripts/scene_manager.gd index 8db892a..cd111c1 100644 --- a/scripts/scene_manager.gd +++ b/scripts/scene_manager.gd @@ -92,5 +92,6 @@ func makeRocket(spawnPosition, direction, speed)->void: print("make a rocket") var myRocket:Rocket = rocketFactory() myRocket.splodeSignal.connect(destroy) + myRocket.impactSignal.connect(game.rocketDamage) myRocket.transform = spawnPosition pushTarget(myRocket,direction*speed)