online multiplayer chess game (note server currently down)
fix html export
- actually disable bad piece sets
| -rw-r--r-- | Grid.gd | 26 | ||||
| -rw-r--r-- | Utils.gd | 4 | ||||
| -rw-r--r-- | export_presets.cfg | 2 |
3 files changed, 18 insertions, 14 deletions
@@ -174,21 +174,21 @@ func mat2str(mat = matrix) -> String: func drawed() -> void: return # TODO: make gameovers work again - Events.emit_signal("game_over") - SoundFx.play("Draw") - yield(get_tree().create_timer(5), "timeout") - Events.emit_signal("go_back") - SoundFx.play("Victory") + # Events.emit_signal("game_over") + # SoundFx.play("Draw") + # yield(get_tree().create_timer(5), "timeout") + # Events.emit_signal("go_back") + # SoundFx.play("Victory") -func win(winner) -> void: +func win(_winner) -> void: return # TODO: make gameovers work again - Events.emit_signal("game_over") - Log.info([winner, " won the game in ", Globals.turns(), " turns!"]) - SoundFx.play("Victory") - yield(get_tree().create_timer(5), "timeout") - Events.emit_signal("go_back") - SoundFx.play("Victory") + # Events.emit_signal("game_over") + # Log.info([winner, " won the game in ", Globals.turns(), " turns!"]) + # SoundFx.play("Victory") + # yield(get_tree().create_timer(5), "timeout") + # Events.emit_signal("go_back") + # SoundFx.play("Victory") func check_in_check(prin = false) -> bool: # check if in_check @@ -342,7 +342,7 @@ func handle_take(position) -> void: func handle_move(position) -> void: - if last_clicked is King and last_clicked.can_castle: + if Utils.is_king(last_clicked) and last_clicked.can_castle: for i in range(len(last_clicked.can_castle)): var castle_data = last_clicked.can_castle[i] if castle_data[0] == position: @@ -17,6 +17,10 @@ static func is_pawn(inode) -> bool: return inode is Pawn +static func is_king(inode) -> bool: + return inode is King + + func add_move(move) -> void: if turn_moves.size() == 0: turn_moves.append(str(Globals.fullmove) + ". " + move) diff --git a/export_presets.cfg b/export_presets.cfg index 566c13a..0da1268 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -39,7 +39,7 @@ runnable=true custom_features="" export_filter="all_resources" include_filter="COPYING.md, LICENSE" -exclude_filter="assets/pieces/cburnett, assets/pieces/fresca, assets/pieces/governor, assets/pieces/horsey, assets/pieces/libra, assets/pieces/maestro, assets/pieces/pixel" +exclude_filter="assets/pieces/alpha/*, assets/pieces/cburnett/*, assets/pieces/fresca/*, assets/pieces/governor/*, assets/pieces/horsey/*, assets/pieces/libra/*, assets/pieces/maestro/*, assets/pieces/pixel/*" export_path="exports/chess.html" script_export_mode=1 script_encryption_key="" |