mirror of
https://git.kittycat.homes/zoe/pegchamp.git
synced 2024-08-15 03:15:39 +00:00
save system
This commit is contained in:
parent
ad8de1dbb7
commit
ffcccb8c2e
29 changed files with 286 additions and 77 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue