end of class 4

This commit is contained in:
Jeremy committed 2024-07-29 21:03:42 -04:00
1 parent a0bc23cc27
commit d37eb7ec8f
17 files changed
+323 -48

No files matched your search

+16 -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,17 @@ 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 = myBox.instantiate()
add_child(box)
box.position = box_trap.position
"powerup":
print("you got power")