online multiplayer chess game (note server currently down)
fix html export
- actually disable bad piece sets
bendn 2022-05-22
parent 3564341 · commit acaafbe
-rw-r--r--Grid.gd26
-rw-r--r--Utils.gd4
-rw-r--r--export_presets.cfg2
3 files changed, 18 insertions, 14 deletions
diff --git a/Grid.gd b/Grid.gd
index 8d19b6c..0554d91 100644
--- a/Grid.gd
+++ b/Grid.gd
@@ -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:
diff --git a/Utils.gd b/Utils.gd
index cfe5ec1..7cef222 100644
--- a/Utils.gd
+++ b/Utils.gd
@@ -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=""