state machine, player animations, bullet pool, some graphics
This commit is contained in:
1 parent
60bde97dba
commit
e24a881958
16 files changed
+477
-13
No files matched your search
@@ -1,6 +1,8 @@
|
||||
class_name GameController extends Node2D
|
||||
|
||||
signal teleportSignal(body:RigidBody2D)
|
||||
signal destroySignal(body)
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
@@ -16,7 +18,7 @@ func _on_trigger(effect: Variant, Object: Variant) -> void:
|
||||
match effect:
|
||||
"destroy":
|
||||
if not Object is Player:
|
||||
Object.queue_free()
|
||||
destroySignal.emit(Object)
|
||||
"teleport":
|
||||
print("Trigger wants to teleport")
|
||||
if Object is Crate:
|
||||
@@ -25,6 +27,6 @@ func _on_trigger(effect: Variant, Object: Variant) -> void:
|
||||
func _on_bullet_hit(body, bullet) -> void:
|
||||
print("GC knows bullet hit")
|
||||
if body is Crate:
|
||||
body.queue_free()
|
||||
bullet.queue_free()
|
||||
destroySignal.emit(body)
|
||||
destroySignal.emit(bullet)
|
||||
|
||||
Reference in new issue
Block a user