2025-06-03 11:45:36 +00:00
|
|
|
extends Node3D
|
|
|
|
|
2025-06-30 18:24:48 +00:00
|
|
|
signal destroy_signal(body)
|
2025-06-03 11:45:36 +00:00
|
|
|
|
|
|
|
func onAreaEntered(effect, obj) -> void:
|
|
|
|
if effect == "destroy":
|
|
|
|
print("destroy the object")
|
|
|
|
obj.queue_free()
|
|
|
|
elif effect == "powerUp":
|
|
|
|
print("power up the object")
|
2025-06-30 18:24:48 +00:00
|
|
|
|
|
|
|
func onBulletHit(bullet, body):
|
|
|
|
print("GC knows bullet hit")
|
|
|
|
if body is Crate:
|
|
|
|
print("hit a crate")
|
|
|
|
destroy_signal.emit(body)
|
|
|
|
destroy_signal.emit(bullet)
|