diff --git a/scripts/Logic/Game.gd b/scripts/Logic/Game.gd index 9c7e1cc..619c1a3 100644 --- a/scripts/Logic/Game.gd +++ b/scripts/Logic/Game.gd @@ -39,7 +39,7 @@ func _ready(): p2_train.hit.connect(_on_hit_player) p1_train.game_over.connect(_on_player_game_over) p2_train.game_over.connect(_on_player_game_over) - p1_train.current_speed = 9 + p1_train.current_speed = 1 p2_train.current_speed = 6 func getMapSize(node, is_start): @@ -55,7 +55,11 @@ func getMapSize(node, is_start): active_map_nodes += 1 func _on_player_game_over(): - pass + $Control/GameOver.visible = true + p1_train.current_speed = 0 + p2_train.current_speed = 0 + p1_train.visible = false + p2_train.visible = false func _on_turn_event(): # @@ -75,14 +79,8 @@ func _on_hit_player(player1,dmg): p1_train.current_speed -= dmg else: p2_train.current_speed -= dmg - - if p1_train.current_speed <= .0001 or p2_train.current_speed <= .0001: - $Control/GameOver.visible = true - p1_train.current_speed = 0 - p2_train.current_speed = 0 - p1_train.visible = false - p2_train.visible = false - + + func _process(delta): if(active_pickups.size() < 1): fillPickups()