Skip to content

Commit

Permalink
Save updated player position
Browse files Browse the repository at this point in the history
  • Loading branch information
maximvl committed Sep 12, 2024
1 parent 0b81883 commit f57e97a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/map/components/MapComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ export default function MapComponent() {
// win condition
}

const newPosition = getNextPlayerPosition(currentPlayer, params.diceRoll)

// save player position in API
makeMove.mutate({
player_id: currentPlayer.id,
dice_roll: params.diceRoll,
move_to: currentPlayer.map_position + params.diceRoll,
move_to: newPosition,
stair_from: params.stairFrom,
stair_to: params.stairTo,
snake_from: params.snakeFrom,
Expand Down

0 comments on commit f57e97a

Please sign in to comment.