week3 prep includes bullet pool, finite state machine, sprites and animation
This commit is contained in:
1 parent
60bde97dba
commit
28d6c23f44
12 files changed
+428
-9
No files matched your search
@@ -1,6 +1,8 @@
|
||||
class_name GameController extends Node2D
|
||||
|
||||
signal teleportSignal(body:RigidBody2D)
|
||||
signal destroySignal(body:Node2D)
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
@@ -25,6 +27,8 @@ 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()
|
||||
#destroy crates
|
||||
destroySignal.emit(body)
|
||||
#remove the bullet
|
||||
destroySignal.emit(bullet)
|
||||
|
||||
Reference in new issue
Block a user