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() initializeStartingDeck()
func initializeStartingDeck(): func initializeStartingDeck():
for i in range(9): deck.clear();
for i in range(4):
deck.append(DoubleTimeCard.new()) deck.append(DoubleTimeCard.new())
deck.append(HopscotchCard.new()) deck.append(HopscotchCard.new())
shuffleDeck() shuffleDeck()

View file

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

View file

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