TonGames is an Web3 Multiplayer Framework for TON and Node.js, with clients available for the Web.
The project focuses on providing synchronizable data structures and channels transactions helpers for realtime web3 and turn-based games, matchmaking, and ease of usage both between many web3 clients.
The mission of the framework is to be a standard netcode & matchmaking solution for any kind of project you can think of web3!
- WebSocket-based communication between dApp and lite Node
- Simple and powerful API in the client-side.
- Automatic state synchronization between dApp and lite Node.
- Simple and usable Ton Channels adapters which can helps you to interract with.
- Game Engine
- Database
- Rest of buisness logic
Keep in mind that your dApp game will interract with TonGames lite Node Server. For the full picture of process let's describe each members.
Simple node.js app which
- handle all game session state changes
- register all possible well defined dApp actions
- init and sync app state data with all connected clients
- provide simple and powerfull api to interract and make payments using Payment channel.
- Sync PaymentChannel balances.
Client side Javascript app which
- register all possible state actions
- init app state
- open dApp channel and using handshake
- handling all server state udpates
Simple dApp demo using TonGames Lite Node server and client
Quick start guide:
0) git clone git@github.com:Dimitreee/ton_games.git
1) cd ton_games
2) git checkout tmp
3) yarn && yarn dev
// lite Node demo server will be started at localhost:4000
4) open new terminal session
5) cd example/channeled_game
6) yarn && yarn dev
Look at the source code for more server implementation details and client implementation details