Search code examples
chessboard.js

How can i put the taken pieces near of board on Chessboard Js


I am trying to develop a chess game against computer or player.

I want to put the captured pieces near of the board to show players' status.

Some functions may help in chessboard.js, but I do not know what to do.


Solution

  • i'm not sure how you're going to implement player/computer turns but in case it's another player playing in the same browser window- chessboard.js supports some events, like onDrop http://chessboardjs.com/examples#4004. you could listen to it, then get the current chess figures via getPosition and render the missing ones anywhere you want.