|
@@ -10,6 +10,7 @@ enum State {
|
|
|
FIRING,
|
|
|
WAITING,
|
|
|
INTERRUPTING,
|
|
|
+ DEAD
|
|
|
}
|
|
|
|
|
|
export var BULLET_SPEED = 500.0
|
|
@@ -68,6 +69,11 @@ func load_bullet(n:int):
|
|
|
nbStorage += n
|
|
|
|
|
|
|
|
|
+func end_of_round():
|
|
|
+ if (current_state != State.DEAD):
|
|
|
+ get_ready()
|
|
|
+
|
|
|
+
|
|
|
func get_ready():
|
|
|
current_state = State.READY
|
|
|
target.position = source.position
|
|
@@ -75,6 +81,10 @@ func get_ready():
|
|
|
nbStorage = 0
|
|
|
|
|
|
|
|
|
+func die():
|
|
|
+ current_state = State.DEAD
|
|
|
+
|
|
|
+
|
|
|
func _on_ShootDelay_timeout():
|
|
|
shoot()
|
|
|
nbAmmo -= 1
|
|
@@ -95,8 +105,12 @@ func _on_Ball_tree_exited():
|
|
|
|
|
|
|
|
|
func _on_Grid_has_moved():
|
|
|
- get_ready()
|
|
|
+ end_of_round()
|
|
|
|
|
|
|
|
|
func _on_Grid_kace_broken():
|
|
|
gain_new_bullet()
|
|
|
+
|
|
|
+
|
|
|
+func _on_DeadLine_game_lost():
|
|
|
+ die()
|