0.1.10 • Published 4 years ago

2048-core v0.1.10

Weekly downloads
39
License
MIT
Repository
github
Last release
4 years ago

core of 2048 (逻辑抽离)

安装

yarn add 2048-core
// or npm instasll 2048-core

usage

import Core from '2048-core'

const core = new Core(size:number)
// size 生成 size * size 的网格

core.init()
// 初始化

core.start()
// 同core.init()

core.getMap()
// 获取网格元数据

core.score()
// 获取分数

core.clear()
// 清空数组

core.restart()
// 类似
// core.clear()
// core.start()

core.addEventListens([name?:string],callback)
// 游戏结束后执行的回调

core.leftMoving()
// 向左移动

core.rightMoving()
// 向右移动

core.topMoving()
// 向上移动

core.bottomMoving()
// 向下移动

运行 demo

git clone git@github.com:mooniitt/2048-core.git

cd 2048-core/demo

yarn install
//or npm install

yarn start
//or npm start

// DONE

license

MIT

0.1.10

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago