fixed on capture glitch

This commit is contained in:
2ManyProjects 2025-01-31 20:06:33 -06:00
parent e51fb4db20
commit 401eb696bd
3 changed files with 7 additions and 5 deletions

View file

@ -23,7 +23,8 @@ func _init():
initializeStartingDeck()
func initializeStartingDeck():
for i in range(9):
deck.clear();
for i in range(4):
deck.append(DoubleTimeCard.new())
deck.append(HopscotchCard.new())
shuffleDeck()

View file

@ -298,6 +298,7 @@ func resetBoard() -> void:
p2String.text = str(p2Points)
gamecheckMate = false;
gamedraw = false;
deckManager.initializeStartingDeck()
areas.clear()
specialArea.clear()

View file

@ -167,15 +167,15 @@ func handleCapture(node: Node) -> void:
game.updatePoints(capturedPiece)
if capturedPiece.name == "King":
print("Game Over!")
game.gamecheckMate = true
capturedPiece.free()
piece.reparent(node)
piece.position = Vector2(25, 25)
piece.position = Vector2(25, 25)
game.currentlyMovingPiece = piece
game.resolveMoveEffects()
if capturedPiece.name == "King":
print("Game Over!")
game.gamecheckMate = true
capturedPiece.free()
func handleRegularMove(node: Node, consume: bool) -> void:
print("handleRegularMove", node)