Skip to content

hahzterry/firstmove

 
 

Repository files navigation

Chunk World - Hackathon Game

A blockchain-based chunk world game built on Sui Network with Kaboom.js game engine.

🎮 Features

  • Chunk-based world editor (5x5 tiles per chunk)
  • 2-layer tile system (base tiles + decorations)
  • On-chain world storage via Sui Move smart contracts
  • Character NFT system
  • Play-to-earn rewards with CHUNK tokens

🛠️ Tech Stack

  • Frontend: React 19, Vite, TailwindCSS
  • Game Engine: Kaboom.js
  • Blockchain: Sui Network (Testnet)
  • Smart Contract: Move language
  • State Management: Zustand
  • Wallet: @mysten/dapp-kit

📋 Prerequisites

🚀 Getting Started

1. Clone the repository

git clone <repository-url>
cd firstmove-hackathon-game

2. Install dependencies

pnpm install

3. Setup environment variables

Copy the example env file and update values:

cp env.example .env

Edit .env with your configuration:

VITE_SUI_RPC=https://fullnode.testnet.sui.io
VITE_PACKAGE_ID=<your-deployed-package-id>
VITE_DUNGEON_CAP=<your-dungeon-cap-object-id>
VITE_WALRUS_WASM_URL=https://unpkg.com/@mysten/walrus-wasm@latest/web/walrus_wasm_bg.wasm
VITE_WALRUS_GATEWAY=https://wal-aggregator-testnet.staketab.org/v1/blobs/by-quilt-patch-id

4. Run development server

pnpm dev

The app will be available at http://localhost:5173

📦 Available Scripts

Command Description
pnpm dev Start development server
pnpm build Build for production
pnpm preview Preview production build
pnpm lint Run ESLint

🔗 Smart Contract (Move)

The Move smart contract is located in the chunk_world/ directory.

Build contract

cd chunk_world
sui move build

Test contract

sui move test

Deploy contract

sui client publish --gas-budget 100000000

After deployment, update VITE_PACKAGE_ID in your .env file with the published package ID.

📁 Project Structure

├── chunk_world/          # Sui Move smart contracts
│   ├── sources/          # Move source files
│   └── tests/            # Move test files
├── public/
│   └── sprites/          # Game sprites and assets
│       ├── decorations/  # Decoration tiles
│       ├── goblin/       # Enemy sprites
│       ├── player/       # Player sprites
│       └── Tiles/        # Base tile sprites
├── src/
│   ├── chain/            # Sui client configuration
│   ├── game/             # Kaboom game logic
│   │   ├── start.ts      # Game initialization
│   │   └── tiles.ts      # Tile definitions
│   ├── pages/            # React pages
│   │   ├── EditorGame.tsx  # Map editor
│   │   ├── GamePage.jsx    # Game player
│   │   └── LandingPage.jsx # Home page
│   └── sui/              # Sui utilities
└── package.json

🎨 Game Controls

  • Arrow Keys / WASD: Move player
  • Editor: Click tiles to place/edit

📝 Configuration

Tile Size

  • TILE_SIZE: 32px
  • CHUNK_SIZE: 5x5 tiles (160x160 pixels per chunk)

Camera

  • Default zoom: 2x

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is private and created for hackathon purposes.

About

UGC platformer “Map = Quest”: players create and share maps, enter difficulty gates B/A/S/SS (higher gates require tickets/tokens), and finish to earn in-game coins plus a chance to drop NFT gear. Multiple leaderboards with Top-N payouts help prevent farming. Walrus stores maps/replays; Sui handles tokens/tickets, the reward pool, and NFT assets.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 45.9%
  • CSS 24.0%
  • JavaScript 21.3%
  • Move 8.7%
  • HTML 0.1%