This commit is contained in:
2022-12-11 09:00:26 +01:00
parent 6a4aa05a18
commit 1a77c484f5
7 changed files with 160 additions and 83 deletions

View File

@@ -37,6 +37,8 @@ func _ready():
p2_train.is_P1 = false
p1_train.hit.connect(_on_hit_player)
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
p2_train.current_speed = 6
@@ -51,7 +53,9 @@ func getMapSize(node, is_start):
else:
getMapSize(node.next, false)
active_map_nodes += 1
func _on_player_game_over():
pass
func _on_turn_event():
#
@@ -68,9 +72,16 @@ func _set_starting_Positions():
func _on_hit_player(player1,dmg):
if not player1:
p2_train.current_speed -= dmg
else:
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):