18 lines
383 B
GDScript
18 lines
383 B
GDScript
extends Node3D
|
|
|
|
signal destroy_signal(body)
|
|
|
|
func onAreaEntered(effect, obj) -> void:
|
|
if effect == "destroy":
|
|
print("destroy the object")
|
|
obj.queue_free()
|
|
elif effect == "powerUp":
|
|
print("power up the object")
|
|
|
|
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)
|