Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.
/ hack-ETH-Prague Public archive

LockBlock is an innovative platformer game with unique blockchain mechanics, where players can purchase map blocks, create custom levels, and save them on the blockchain to build an infinite gaming world.

Notifications You must be signed in to change notification settings

madvil2/hack-ETH-Prague

Repository files navigation

🎮 LockBlock - Infinite Blockchain Platformer Game

ETH Prague Hackathon Project

LockBlock is an innovative platformer game with unique blockchain mechanics, where players can purchase map blocks, create custom levels, and save them on the blockchain to build an infinite gaming world.

🌟 Concept

Core Idea

  • Infinite World: Game map consists of purchasable and buildable blocks
  • Level Creation: Players can build custom maps in their owned blocks
  • Gameplay Validation: Maps must be successfully completed to be saved
  • Blockchain Integration: All maps are stored on blockchain and added to the global world
  • Global Statistics: Death count and player achievement tracking system

Game Mechanics

  1. Block Purchasing: Players buy map sections with cryptocurrency
  2. Level Editor: Built-in tool for creating platformer levels
  3. Testing: Mandatory completion of created levels for validation
  4. Publishing: Successfully completed levels are added to the global map
  5. Playing: Players traverse the infinite map created by the community

🚀 Quick Start

# Install dependencies
pnpm install

# Start development server
pnpm dev

# Build for production
pnpm build

# Lint code
pnpm lint

🛠 Tech Stack

Frontend

  • React 19 - Modern UI framework
  • TypeScript - Typed JavaScript
  • Phaser 3 - 2D game engine
  • Vite - Fast bundler and dev server
  • SCSS Modules - Modular styling

Blockchain

  • Ethers.js - Ethereum interaction
  • MetaMask - Wallet connection
  • Viem - Modern Ethereum library
  • Nitrolite - Optimized blockchain operations

Additional Technologies

  • React Router v7 - Routing
  • i18next - Internationalization
  • Radix UI - UI components
  • Biome - Code linter and formatter

🎯 Key Features

🎮 Game Engine

  • Mario-style platformer with physics
  • Touch controls support for mobile devices
  • Performance optimization for different devices
  • Animation and sprite system

🏗 Level Editor

  • Intuitive interface for map creation
  • Library of game objects (platforms, enemies, bonuses)
  • Preview and testing capabilities
  • Validation through gameplay

⛓ Blockchain Integration

  • Map block purchasing through smart contracts
  • Decentralized map storage
  • Block ownership and trading system
  • Global statistics and achievements

📱 User Interface

  • Responsive design for all devices
  • Multi-language support
  • Modern and intuitive UX
  • MetaMask integration

🏗 Project Architecture

src/
├── components/          # React components
│   ├── Game/           # Game engine and logic
│   ├── MetaMaskConnection.tsx
│   └── SmartContractDemo.tsx
├── hooks/              # Custom hooks
│   ├── useMetaMask.ts
│   ├── useSmartContract.ts
│   └── useNitroliteIntegration.ts
├── pages/              # Application pages
│   ├── GamePage/
│   ├── LevelEditorPage/
│   └── MainPage/
├── utils/              # Utilities and services
│   ├── smartContractService.ts
│   └── nitrolite/
└── types/              # TypeScript types

🎨 Game Assets

The project includes a complete set of sprites and animations:

  • Player character with animations
  • Platforms and environment tiles
  • Animated objects (flags, effects)
  • Background elements

🔧 Development Setup

Recommended VSCode Extensions

  • Biome - Code formatting and linting
  • React CSS Modules - CSS Modules support

VSCode Settings

{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "biomejs.biome",
  "editor.codeActionsOnSave": {
    "source.organizeImports.biome": "explicit"
  }
}

🌐 Blockchain Integration

Smart Contracts

  • Map block ownership management
  • Block buying and selling system
  • Level validation and storage
  • Global player statistics

Supported Networks

  • Ethereum Mainnet
  • Polygon
  • Arbitrum
  • Other EVM-compatible networks

🎯 Future Plans

  • Multiplayer: Cooperative level completion
  • NFT Integration: Unique in-game items
  • Tournaments: Competitive events
  • Mobile App: Native iOS/Android applications
  • VR Support: Virtual reality experience

🤝 Contributing

We welcome community contributions! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Create a Pull Request

📄 License

This project was created for ETH Prague hackathon and is distributed under an open license.

🏆 Team

Project developed by blockchain gaming enthusiasts for ETH Prague hackathon.


Play, Create, Own - Welcome to the Future of Gaming! 🚀

About

LockBlock is an innovative platformer game with unique blockchain mechanics, where players can purchase map blocks, create custom levels, and save them on the blockchain to build an infinite gaming world.

Resources

Stars

Watchers

Forks