save system

This commit is contained in:
zoe 2021-10-01 16:23:48 +02:00
parent ad8de1dbb7
commit ffcccb8c2e
29 changed files with 286 additions and 77 deletions

View file

@ -1,5 +1,6 @@
extends KinematicBody2D
signal level_just_won
enum {IDLE, MOVEUP, MOVEDOWN}
var state = IDLE
@ -8,6 +9,7 @@ func _on_Killzone_body_entered(body):
body.reset_ball()
state = MOVEUP
GameStats.add_balls(-1)
if body.has_method("explode"):
if (body.has_method("set_particle_direction")):
body.set_particle_direction(Vector2(0, -10))
@ -28,4 +30,6 @@ func movedown():
func _on_ZoneDetection_area_entered(_area):
if (state == MOVEUP):
state = MOVEDOWN
if GameStats.level_won:
emit_signal("level_just_won")
else: state = IDLE