This commit is contained in:
2022-12-11 09:07:25 +01:00
parent 0e6bce027f
commit 79864b9b5e

View File

@@ -39,7 +39,7 @@ func _ready():
p2_train.hit.connect(_on_hit_player) p2_train.hit.connect(_on_hit_player)
p1_train.game_over.connect(_on_player_game_over) p1_train.game_over.connect(_on_player_game_over)
p2_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 p2_train.current_speed = 6
func getMapSize(node, is_start): func getMapSize(node, is_start):
@@ -55,7 +55,11 @@ func getMapSize(node, is_start):
active_map_nodes += 1 active_map_nodes += 1
func _on_player_game_over(): 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(): func _on_turn_event():
# #
@@ -76,12 +80,6 @@ func _on_hit_player(player1,dmg):
else: else:
p2_train.current_speed -= dmg 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): func _process(delta):
if(active_pickups.size() < 1): if(active_pickups.size() < 1):