【文件属性】:
文件名称:way-of-life:Conway的生活游戏以JavaScript和WebAssembly实现,呈现在画布上
文件大小:321KB
文件格式:ZIP
更新时间:2021-04-24 00:24:01
javascript game-of-life webassembly conway-game canvas-element
生活方式
Conway的生活游戏在JavaScript和WebAssembly中均使用画布元素进行渲染。
安装
npm软件包仅链接到ES6代码,因此目前仅可用作依赖项。
npm install --save-dev way-of-life
用法
import { Engine , acorn } from 'way-of-life'
// initialize the game with an empty 40x40 matrix
const engine = new Engine ( 40 , 40 )
engine . init ( )
// initialize some living cells around the center of the matrix
acorn ( engine , 20 , 20 )
// compute the next state of game
【文件预览】:
way-of-life-master
----.gitignore(14B)
----.babelrc(39B)
----package.json(2KB)
----src()
--------js()
--------index.html(5KB)
--------embed.html(32B)
--------styles()
----.travis.yml(35B)
----LICENSE(1KB)
----README.md(1KB)
----conf()
--------webpack.config.demo.js(2KB)
--------webpack.config.embed.js(2KB)
----docs()
--------engine.wasm(8KB)
--------js()
--------css()
--------index.html(4KB)
--------embed.html(138B)
----yarn.lock(341KB)