boardgame.io README

The project's README from github.com/boardgameio/boardgame.io. As one markdown file: README.md.

boardgame.io

npm version Build Status Coverage Status Gitter

Read the Documentation

boardgame.io is an engine for creating turn-based games using JavaScript.

Write simple functions that describe how the game state changes when a particular move is made. This is automatically converted into a playable game complete with online multiplayer features, all without requiring you to write a single line of networking or storage code.

Features

Usage

Installation

npm install boardgame.io

Documentation

Read our Full Documentation to learn how to use boardgame.io, and join the community on gitter to ask your questions!

Running examples in this repository

npm install
npm start

The examples can be found in the examples folder.

Using VS Code?

This repository is ready to run in a dev container in VS Code. See the contributing guidelines for details.

Changelog

See changelog.

Get involved

We welcome contributions of all kinds! Please take a moment to review our Code of Conduct.

🐛 Found a bug?
Let us know by creating an issue.

❓ Have a question?
Our Gitter channel and GitHub Discussions are good places to start.

⚙️ Interested in fixing a bug or adding a feature?
Check out the contributing guidelines and the project roadmap.

📖 Can we improve our documentation?
Pull requests even for small changes can be helpful. Each page in the docs can be edited by clicking the “Edit on GitHub” link at the top right.

License

MIT

boardgame.io (boardgameio/boardgame.io)

Searching Database…

这是什么?一个用 JavaScript 开发回合制游戏的开源引擎:你只需编写描述每个操作如何改变游戏状态的函数,它就能把它们变成一个可在线联机的完整游戏——不需要自己写任何网络或存储相关的代码。
那我是要从零写整个游戏,还是它会帮我把棋盘画出来?它是一个 npm 框架,不是应用也不是编辑器。状态、回合、联机对战和机器人由它负责,而棋盘画面你可以用任意视图层来渲染——纯 JS 客户端,或者 React / React Native 绑定都行。
我怎么把它跑起来?用 npm 安装这个包,然后照着文档里的教程做。这个仓库在 examples 文件夹里还附带了能直接运行的游戏示例,并且支持用 VS Code 开发容器直接打开。
我需要先装好 Node.js 或其他东西吗?只需要一个 JavaScript 环境:游戏在浏览器里运行,联机服务器跑在 Node.js 上。如果要给这个仓库本身贡献代码,则需要 Node >= 22.12 和 pnpm >= 10.16。
它能支持的游戏类型有什么限制吗?它是专门为回合制游戏打造的——棋类、卡牌、策略类游戏都适合。即时动作类游戏不在它的适用范围内。
我做好的游戏实际能跑在哪里?凡是能运行 JavaScript 的地方都行:通过纯 JS 客户端或 React 在浏览器中运行,也可以通过 React Native 绑定跑在 iOS 和 Android 上,游戏状态在客户端和服务器之间无缝同步。
在做界面之前,我能先测试我的规则吗?可以——它提供了一个原型调试界面,甚至在渲染游戏画面之前就能模拟各种操作,你可以先把规则敲定下来。
一局游戏进行到一半,我怎么调试或回看?引擎会记录带时间回溯功能的游戏日志:你可以一步步退回去,查看棋盘在之前任意时刻的状态。
我能给引擎加自己的抽象吗?可以——它有插件系统,既能创建新的抽象,也能扩展引擎的行为。
这个项目还在活跃维护吗?看起来很不错:GitHub 上大约有 12,500 颗星,从 2017 年开发至今,仓库里还有更新日志以及 CI 和 npm 发布的工作流。
What are similar projects?GDevelop, phaser, flame, luanti, ignite, libgdx, formily, Babylon.js
Size
13.4 MB
Stars
12.5K
Updated
CommitAug 10
Age
8y
Commits · 90 Days