Spawn crates and leave in broken state

This commit is contained in:
winniewk committed 2024-07-29 21:07:47 -04:00
1 parent 386ab393c9
commit f2241640ae
19 files changed
+301 -27

No files matched your search

+2 -1
View File
@@ -5,4 +5,5 @@ signal areatrigger(effect, Object)
func _on_body_entered(body):
print("detected a body")
areatrigger.emit(effect, body)
if body.get_collider() != StaticBody2D:
areatrigger.emit(effect, body)
+10 -2
View File
@@ -1,5 +1,7 @@
extends Node2D
var myBox = preload("res://scenes/crate.tscn")
@onready var box_trap = $BoxTrap
# Called when the node enters the scene tree for the first time.
func _ready():
@@ -11,5 +13,11 @@ func _process(delta):
pass
func _on_area_2d_areatrigger(effect, Object):
print("Game Controller sees the trigger")
func _on_area_2d_areatrigger(effect, body):
print("Game Controller sees the trigger " + effect)
match effect:
"alert":
for n in 5:
var box = myBox.instantiate()
add_child(box)
box.transform = box_trap.global_transform