0.9.2 • Published 3 years ago
ymir-js v0.9.2
ymir-js
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.
Create Board
const board = new Board({ x: 3, y: 3 });Set Item
const item = new Item({ name: 'myFirstItem' });
board.setItem('0|0', item);Get Item
board.getItem('0|0');
// => { name: 'myFirstItem', ... }Move Item
board.moveItem('0|0', '1|1');Remove Item
board.removeItem('1|1');Switch Item
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', ... }Empty Control
board.isEmpty('2|2');
// => trueExist Control
const board = new Board({ x: 3, y: 3 });
board.isExistCoord('5|5');
// => falseGet Matrix
board.getBoardMatrix();
/* =>
[
[{ item }, { item }, { item }],
[{ item }, { item }, { item }],
[{ item }, { item }, { item }]
]
*/Roadmap
| Name | Status | Link |
|---|---|---|
| Turkish Checkers | WIP | Source |
| International Checkers | WIP | Source |
| Chess | - | - |
| Match 3 Puzzle | - | - |
| Go | - | - |
0.9.0
3 years ago
0.8.1
3 years ago
0.9.2
3 years ago
0.9.1
3 years ago
0.3.0
3 years ago
0.2.0
3 years ago
0.8.0
3 years ago
0.7.1
3 years ago
0.5.0
3 years ago
0.4.1
3 years ago
0.4.0
3 years ago
0.3.1
3 years ago
0.7.0
3 years ago
0.4.3
3 years ago
0.6.0
3 years ago
0.4.2
3 years ago
0.1.7
4 years ago
0.1.6
4 years ago
0.1.5
4 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago