diff options
Diffstat (limited to 'Scripts/Player.gd')
-rw-r--r-- | Scripts/Player.gd | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Scripts/Player.gd b/Scripts/Player.gd index e422ba8..f3b9667 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -6,8 +6,11 @@ class_name Player var target : NumberNode var legal : bool +var gameloop : GameLoop + func _ready(): GlobalVariables.player = self + gameloop = GlobalVariables.gameloop func _input(event): if GlobalVariables.is_snapping: @@ -25,8 +28,9 @@ func _input(event): if event is InputEventMouseButton && !event.pressed: GlobalVariables.is_snapping = false - if target != null: + if target != null && gameloop.current_turns < gameloop.turns: target.join_from($"..") + gameloop.current_turns += 1 line.points[1] = Vector2.ZERO |