bullets firing, scene manager, teleport, force push
This commit is contained in:
1 parent
c8d5474785
commit
60bde97dba
15 files changed
+251
-54
No files matched your search
@@ -1,6 +1,6 @@
|
||||
extends Node2D
|
||||
|
||||
class_name GameController extends Node2D
|
||||
|
||||
signal teleportSignal(body:RigidBody2D)
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
@@ -13,6 +13,18 @@ func _process(delta: float) -> void:
|
||||
|
||||
func _on_trigger(effect: Variant, Object: Variant) -> void:
|
||||
print("GC knows about trigger")
|
||||
if effect == "destroy":
|
||||
if not Object is Player:
|
||||
Object.queue_free()
|
||||
match effect:
|
||||
"destroy":
|
||||
if not Object is Player:
|
||||
Object.queue_free()
|
||||
"teleport":
|
||||
print("Trigger wants to teleport")
|
||||
if Object is Crate:
|
||||
teleportSignal.emit(Object)
|
||||
|
||||
func _on_bullet_hit(body, bullet) -> void:
|
||||
print("GC knows bullet hit")
|
||||
if body is Crate:
|
||||
body.queue_free()
|
||||
bullet.queue_free()
|
||||
|
||||
Reference in new issue
Block a user