This toolkit is created to make it easier for you to develop games like chess, checkers, go, match 3 puzzle and more. It is still under development.
const board = new Board({ x: 3, y: 3 });
const item = new Item({ name: 'myFirstItem' });
board.setItem('0|0', item);
board.getItem('0|0');
// => { name: 'myFirstItem', ... }
board.moveItem('0|0', '1|1');
board.removeItem('1|1');
const firstItem = new Item({ name: 'myFirstItem' });
const secondItem = new Item({ name: 'mySecondItem' });
board.setItem('0|0', firstItem);
board.setItem('1|1', secondItem);
board.switchItem('0|0', '1|1');
board.getItem('0|0');
// => { name: 'mySecondItem', ... }
board.getItem('1|1');
// => { name: 'myFirstItem', ... }
board.isEmpty('2|2');
// => true
const board = new Board({ x: 3, y: 3 });
board.isExistCoord('5|5');
// => false
board.getBoardMatrix();
/* =>
[
[{ item }, { item }, { item }],
[{ item }, { item }, { item }],
[{ item }, { item }, { item }]
]
*/
Name | Status | Link |
---|---|---|
Turkish Checkers | WIP | Source |
International Checkers | WIP | Source |
Chess | - | - |
Match 3 Puzzle | - | - |
Go | - | - |