Skip to content

gamv-io/sample-arcade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gamvio Sample: Arcade Games

5 arcade games built with the Gamvio Game SDK — ready to play, ready to fork.

Next.js 15 React 19 TypeScript Gamvio SDK License: MIT

Live Demo · SDK Docs · Developer Portal


Game Showcase

Game Description Highlights
🚀 Gravity Flip Defy physics in a world where gravity is your weapon. Tap to flip between floor and ceiling, dodge obstacles, and chain combos for massive scores. One-tap controls, combo multiplier, increasing speed
🏎️ Neon Racer Tear through a neon-lit highway at breakneck speed. Weave between traffic, collect boost pickups, and survive as long as you can in this top-down arcade racer. Top-down perspective, traffic AI, boost mechanics
🏃 Pixel Runner A lovingly crafted pixel-art endless runner. Jump, slide, and dash through procedurally generated terrain — every run is different. Procedural generation, pixel-art aesthetic, 3 abilities
🎵 Rhythm Tap Four lanes, one beat. Notes fall to the rhythm — tap in time to build your streak. Miss three and it's game over. 4-lane note highway, accuracy grading, streak system
💎 Asteroid Miner Pilot your mining ship through dense asteroid fields. Drill for precious minerals, dodge debris, and deliver cargo before your fuel runs out. Resource management, fuel system, cargo delivery

Quick Start

git clone https://github.com/gamv-io/sample-arcade.git
cd sample-arcade
cp .env.example .env.local   # Add your SDK keys from dev.gamv.io
npm install
npm run dev                   # Open http://localhost:3100

That's it. Five games, running locally in under a minute.

Test Mode

When running on localhost, the SDK automatically activates test mode:

  • No platform login required — a test player token is issued automatically
  • Scores are submitted to a sandboxed leaderboard (not production)
  • Session HMAC signing works identically to production, so your integration code stays the same
  • Perfect for development, QA, and demos

To connect to the real platform, deploy your build and set your production API keys in the environment.

SDK Integration

Every game in this project follows the same integration pattern using Next.js Server Actions — your secrets never leave the server.

games/
├── gravity-flip/
│   ├── gravity-flip-game.tsx   ← Client component (game logic + rendering)
│   └── actions.ts              ← Server actions (SDK calls)
├── neon-racer/
│   └── ...
└── registry.ts                 ← Game metadata registry

How It Works

  1. lib/gamvio.ts — Shared server-side SDK setup. Creates a GameServer instance with your API credentials. All secrets stay server-side.

  2. games/*/actions.ts — Each game exports server actions that wrap SDK methods:

    • startGameSession() — Begin a scored session with HMAC anti-cheat
    • submitScore() — Server-signed score submission (tamper-proof)
    • getLeaderboard() — Fetch global rankings
  3. games/*/[game]-game.tsx — Client-side game component that calls server actions directly. No API routes needed.

// Example: submitting a score from a game component
import { submitScore } from './actions';

async function handleGameOver(score: number) {
  const result = await submitScore(accessToken, sessionId, hmacKey, score, {
    level: currentLevel,
    combo: maxCombo,
  });
}

Key Features

Feature How
Anti-cheat HMAC-signed sessions — scores are cryptographically verified server-side
Leaderboards Global rankings via getLeaderboard(), personal rank via getMyRank()
Multi-game Single project hosts 5 games — each resolved by slug via resolveGameId()
Zero client secrets All SDK calls run in Server Actions — nothing sensitive reaches the browser

Tech Stack

Layer Technology
Framework Next.js 15 (App Router)
UI React 19 + TypeScript 5.7
Game SDK @gamvio/game-sdk
Rendering Canvas API / React components (per game)
Server Logic Next.js Server Actions ('use server')

Project Structure

sample-arcade/
├── app/                    # Next.js App Router pages
├── games/
│   ├── gravity-flip/       # Each game is self-contained
│   ├── neon-racer/
│   ├── pixel-runner/
│   ├── rhythm-tap/
│   ├── asteroid-miner/
│   └── registry.ts         # Game metadata & routing
├── lib/
│   └── gamvio.ts           # Shared SDK server setup
├── public/                 # Static assets
├── .env.example            # Required env vars template
└── package.json

Links

License

MIT -- see LICENSE for details.


Built with Gamvio -- the Web3 game platform for developers who ship.

About

Sample arcade games built with @gamvio/game-sdk — Gravity Flip, Neon Racer, Pixel Runner, Rhythm Tap, Asteroid Miner

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors