fixed board reset
This commit is contained in:
parent
4f00d01f82
commit
b5b2b977ad
2 changed files with 4 additions and 4 deletions
|
|
@ -280,7 +280,8 @@ func isValidMove(location: String) -> bool:
|
||||||
|
|
||||||
|
|
||||||
func resetBoard() -> void:
|
func resetBoard() -> void:
|
||||||
clearBoard();
|
clearSelection()
|
||||||
|
clearBoard()
|
||||||
setupPieces()
|
setupPieces()
|
||||||
Turn = 0
|
Turn = 0
|
||||||
currentPlayer = WHITE
|
currentPlayer = WHITE
|
||||||
|
|
@ -288,6 +289,8 @@ func resetBoard() -> void:
|
||||||
p1String.text = str(p1Points)
|
p1String.text = str(p1Points)
|
||||||
p2Points = 0
|
p2Points = 0
|
||||||
p2String.text = str(p2Points)
|
p2String.text = str(p2Points)
|
||||||
|
gamecheckMate = false;
|
||||||
|
gamedraw = false;
|
||||||
|
|
||||||
areas.clear()
|
areas.clear()
|
||||||
specialArea.clear()
|
specialArea.clear()
|
||||||
|
|
@ -362,7 +365,6 @@ func resolveMoveEffects() -> void:
|
||||||
|
|
||||||
func resetHighlights():
|
func resetHighlights():
|
||||||
for button in boardContainer.get_children():
|
for button in boardContainer.get_children():
|
||||||
print(button.name)
|
|
||||||
if !button.name.contains("-"):
|
if !button.name.contains("-"):
|
||||||
continue
|
continue
|
||||||
var coord = button.name.split("-")
|
var coord = button.name.split("-")
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ func enter(_previous: String, data := {}) -> void:
|
||||||
"draw":
|
"draw":
|
||||||
handleDraw()
|
handleDraw()
|
||||||
|
|
||||||
# Reset state for next round
|
|
||||||
game.clearSelection();
|
|
||||||
game.resetBoard()
|
game.resetBoard()
|
||||||
finished.emit(Constants.WHITE_TURN)
|
finished.emit(Constants.WHITE_TURN)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue