Frontend part
Example game front-end structure can be found here – apps/web/games:
- GameView.tsx
- RandzuPage.tsx
- matchQueue.tsx
- sessionKeyStorage.tsx
- config.ts
Every game should include a config.ts
file where game config is defined:
config.ts
import { createZkNoidGameConfig } from "@/lib/createConfig";
import { RandzuLogic } from "zknoid-chain-dev";
import RandzuPage from "./components/RandzuPage";
export const randzuConfig =
createZkNoidGameConfig({
id: 'randzu',
name: 'Randzu',
description: 'Two players take turns placing pieces on the board attempting to create lines of 5 of their own color',
image: '/randzu.jpeg',
runtimeModules: {
RandzuLogic
},
page: RandzuPage,
});
It defines game meta information, runtime modules used by the game and game page components.
Game config can be used to create an AppChainClient
object
ZkNoid provides infrastructure such as
- Wallet connection
- Dealing with L1 and L2 protokit appchain
- Accessing balances
- Bridging tokens
- Reading data
- Making transactions
- Storing session keys
- Onchain part
- Competitions support
- Matchmaking support
- Collisions calculation
- Pseudorandomness support
- Commit-reveal scheme
- Noises e.g. Perlin for maps generation
- Recursive proofs calculation support on front-end