added box trap

This commit is contained in:
OddlyTimbot committed 2024-08-04 18:53:22 -04:00
1 parent e8da3ca6c6
commit 8617bafe71
14 files changed
+63 -53

No files matched your search

+15 -12
View File
@@ -1,15 +1,18 @@
extends Node2D
var crate = preload("res://scenes/crate.tscn")
@onready var boxtrap = $crates/boxtrap
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
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":
#do stuff
print("hi")
if body.is_in_group("player"):
for n in 3:
var box = crate.instantiate()
add_child(box)
box.position = boxtrap.position
"powerup":
print("you got power")