https://github.com/aykutkardas/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.
https://github.com/aykutkardas/ymir-js
checkers chess game game-development go match3 toolkit
Last synced: over 1 year ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/aykutkardas/ymir-js
- Owner: aykutkardas
- Created: 2020-05-18T00:23:30.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-09-27T21:26:19.000Z (almost 3 years ago)
- Last Synced: 2025-02-27T13:29:42.572Z (over 1 year ago)
- Topics: checkers, chess, game, game-development, go, match3, toolkit
- Language: TypeScript
- Homepage:
- Size: 578 KB
- Stars: 34
- Watchers: 5
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```js
const board = new Board({ x: 3, y: 3 });
```
### Set Item
```js
const item = new Item({ name: 'myFirstItem' });
board.setItem('0|0', item);
```
### Get Item
```js
board.getItem('0|0');
// => { name: 'myFirstItem', ... }
```
### Move Item
```js
board.moveItem('0|0', '1|1');
```
### Remove Item
```js
board.removeItem('1|1');
```
### Switch Item
```js
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
```js
board.isEmpty('2|2');
// => true
```
### Exist Control
```js
const board = new Board({ x: 3, y: 3 });
board.isExistCoord('5|5');
// => false
```
### Get Matrix
```js
board.getBoardMatrix();
/* =>
[
[{ item }, { item }, { item }],
[{ item }, { item }, { item }],
[{ item }, { item }, { item }]
]
*/
```
---
## Roadmap
| Name | Status | Link |
| ---------------------- | ------ | --------------------------------------------------------------- |
| Turkish Checkers | WIP | [Source](https://github.com/aykutkardas/turkish-checkers) |
| International Checkers | WIP | [Source](https://github.com/aykutkardas/international-checkers) |
| Chess | - | - |
| Match 3 Puzzle | - | - |
| Go | - | - |
---