A fully on-chain multiplayer arcade mini-game built with Phaser 3, Next.js, React, and GORBAGANA integration. Players compete in real-time to collect tokens, avoid obstacles, and earn on-chain rewards in a fast-paced arena. The game leverages gorbagana testnet for wallet management, in-game rewards, and penalties, providing a unique play-to-earn experience.
- Connect Wallet: Players connect their wallet to participate.
- In-Game Wallet: An in-game wallet is created and funded for each player. Fund the in-game wallet with 0.01 GOR to be able to play the game.
- Lobby & Matchmaking: Players join a lobby(for which min 0.01 GOR is required) and are matched into a game room.
- Arena: The game starts in a scrolling arena with obstacles and tokens.
- Controls: Use arrow keys to move your avatar.
- Scoring:
- Collect tokens to increase your score and you get rewarded with 2 GOR for each hit.
- Hitting obstacles decreases your score and you get penalized with 1 GOR for each hit.
- Leaderboard: Scores are displayed in real-time.
- End of Round: When time is up, the winner is determined and rewarded on-chain.
- Withdrawal: User can withdraw required amount of tokens from the game wallet to their connected wallet address.
- Every game action is an in-game transaction on the gorbagana testnet
- Real-time multiplayer arena
- On-chain rewards and penalties
- Dynamic obstacles and escalating difficulty
- Live leaderboard and results
- Each player is assigned an in-game wallet (managed via Prisma and Solana).
- Collecting tokens triggers a in-game gorbagana transaction to reward the player from the global pool.
- Hitting obstacles triggers a penalty transaction from the player to the global pool.
- Winners receive on-chain rewards at the end of each round.
Here's the program architecture

Instructions:
init_pool: Initializes the global pool for tracking games and holding funds.create_round: Starts a new game round, associating it with the global pool.obstacle_hit: Transfers a penalty from the player to the pool when an obstacle is hit.reward: Sends a reward from the pool to a player (admin only).withdraw: Allows a player to withdraw funds from the game wallet.round_over: Marks a round as finished and records the winner and prize.
You can view the program here.
- Frontend: Next.js, React, Phaser 3
- Backend: Node.js, Socket.IO, Prisma, PostgreSQL
- Blockchain: Gorbagana, @coral-xyz/anchor, @solana/web3.js, Anchor+Rust for the Program
- Other: TypeScript, Vite, Sonner (toasts), Prisma ORM
- Node.js (v18+ recommended)
- npm or yarn
- PostgreSQL database
- Solana CLI (for wallet management)
git clone <your-repo-url>
cd gorbagana-mini-gamenpm install
# or
yarn install- Copy
.env.exampleto.envand fill in your database and Solana credentials. - Set up your PostgreSQL database and update
prisma/schema.prismaif needed.
npx prisma generate
npx prisma migrate deploynpm run dev- This will start both the Next.js frontend and the Socket.IO game server.
- Open your browser and go to
http://localhost:3000 - Connect your Solana wallet.
- Fund your in-game wallet if prompted.
- Join a lobby and start playing!
This project is licensed under the MIT License. See the LICENSE file for details.