online multiplayer chess game (note server currently down)
| -rw-r--r-- | Grid.gd | 4 | ||||
| -rw-r--r-- | ui/Timer.gd | 2 | ||||
| -rw-r--r-- | ui/TimerLabels.gd | 4 |
3 files changed, 5 insertions, 5 deletions
@@ -162,8 +162,8 @@ func check_in_check(prin = false) -> bool: # check if in_check for i in range(0, 8): # for each row for j in range(0, 8): # for each column var spot = matrix[i][j] # get the square - if spot and spot.white != Globals.team: # enemie - if spot.can_attack_piece(Globals.white_king if Globals.team else Globals.black_king): # if it can take the king + if spot and spot.white != Globals.turn: # enemie + if spot.can_attack_piece(Globals.white_king if Globals.turn else Globals.black_king): # if it can take the king if prin: Globals.in_check = true # set in_check Globals.checking_piece = spot # set checking_piece diff --git a/ui/Timer.gd b/ui/Timer.gd index 4896962..6915862 100644 --- a/ui/Timer.gd +++ b/ui/Timer.gd @@ -15,7 +15,7 @@ func _ready() -> void: func _process(delta) -> void: if !enabled: return - if Globals.team: + if Globals.turn: if !whitelabel.set_time(whitelabel.time - delta): enabled = false else: diff --git a/ui/TimerLabels.gd b/ui/TimerLabels.gd index 6885881..03e8aee 100644 --- a/ui/TimerLabels.gd +++ b/ui/TimerLabels.gd @@ -38,6 +38,6 @@ func _on_game_over() -> void: func set_color() -> void: if time > 10: - colorrect.color = Globals.grid.clockrunning_color if Globals.team == white else Color.transparent + colorrect.color = Globals.grid.clockrunning_color if Globals.turn == white else Color.transparent else: - colorrect.color = Globals.grid.clockrunninglow if Globals.team == white else Globals.grid.clocklow + colorrect.color = Globals.grid.clockrunninglow if Globals.turn == white else Globals.grid.clocklow |