finishing rockets

This commit is contained in:
OddlyTimbot 2026-07-06 12:30:43 -04:00
parent 4eb6966ef1
commit 5fb367e082
3 changed files with 7 additions and 0 deletions

View File

@ -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]

View File

@ -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)

View File

@ -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)