All projects
GenLayer2026/04/14

Road Survival โ€” Multiplayer Racing Game

ReactGameGenLayer
Road Survival
Road Survival

Road Survival is an advanced multiplayer racing game built with React and integrated with GenLayer blockchain. Featuring real-time multiplayer racing, diverse car selection, and immersive gameplay with sound effects and realistic environments.

Key Features

๐ŸŽฎ Game Modes

Multiplayer - Real-time racing with other players Solo Practice - Training mode to improve skills Room System - Create/join custom game rooms

๐Ÿš— Car Selection System

9 Unique Car Types: Sports, SUV, Sedan, Hatchback, Muscle, Truck, Racing, F1, Luxury Different Car Shapes: Each car type has unique visual design (F1 with nose cone & wings, SUV taller & boxier, Truck longer with bed, etc.) Color Variations: Each car type has distinct color scheme Live Preview: See car preview before selecting

๐Ÿ”Š Sound Effects

Engine Sound: Dynamic engine sound that changes based on speed Collision Sound: Impact sound when crashing into enemy cars Web Audio API: High-quality synthesized sounds without external files

๐ŸŒฒ Realistic Environment

Dynamic Scenery: Trees, buildings, and mountains on both sides of the road Moving Background: Scenery moves with road for realistic speed sensation Depth Effect: Mountains in background, buildings mid-ground, trees foreground Variety: Random placement for natural look

๐ŸŽจ Modern UI/UX

React 18 - Modern component architecture Tailwind CSS - Responsive, utility-first styling Framer Motion - Smooth animations and transitions Lucide Icons - Beautiful, consistent iconography Mobile Responsive - Works on all devices

Technology Stack

Technologies Used

**Frontend:** React 18 + Vite + Tailwind CSS

**Blockchain:** GenLayer Studionet

**Real-time:** Socket.IO WebSocket

**Game Engine:** HTML5 Canvas + JavaScript

**Build Tool:** Vite (fast HMR)

Game Controls

Keyboard Controls

  • โ–ธโ† โ†’ Arrow Keys - Move left/right between lanes
  • โ–ธA/D Keys - Alternative movement
  • โ–ธSpace - Start game (when ready)

Game Mechanics

  • โ–ธAvoid enemy cars - Collision = game over
  • โ–ธEnemy variety - Enemy cars have random types and colors, different from player car
  • โ–ธSpeed increase - Gets faster as score increases
  • โ–ธEngine sound - Dynamic engine sound changes with speed
  • โ–ธCollision sound - Impact sound when crashing
  • โ–ธRestart - Click "Main Lagi" to instantly restart after game over

Blockchain Integration

The game integrates with GenLayer blockchain for score tracking and multiplayer sessions. Smart contracts store player scores and game sessions on-chain, ensuring transparency and immutability.

Contract Name: RoadSurvivalGame

Network: GenLayer Studionet

Storage: String-based key-value pairs for sessions and scores

GenLayer-Specific Features

This project demonstrates full integration with GenLayer's unique capabilities:

๐Ÿง  LLM Integration

AI-Generated Car Descriptions: Use GenLayer's LLM to create unique, dynamic car descriptions AI Game Commentary: Auto-generate exciting commentary for game events Dynamic Content: All descriptions and commentary are generated in real-time by the LLM

๐ŸŒ Web Fetching

Real-Time Weather Data: Fetch live weather conditions from external APIs Car Statistics: Pull real car data from Wikipedia Dynamic Game Mechanics: Weather affects game difficulty (rain = slippery roads, etc.)

โš–๏ธ Equivalence Principle

Deterministic Difficulty Calculation: Mathematical operations that produce consistent results across different LLMs Score Fairness Validation: Ensures scores are within reasonable bounds using deterministic rules Game Recommendations: Provides consistent recommendations using structured logic

Mobile Support

The game features responsive design that works on all devices:

  • โ–ธDesktop: Full 12-column grid layout
  • โ–ธTablet: 8-column grid with adjusted spacing
  • โ–ธMobile: Single column, touch-friendly controls

๐Ÿ“š Source Code

Want to see the full project? Check out the complete source code on GitHub: https://github.com/dhozil/road-survival

Built by dhozil for the gaming and blockchain community ๐Ÿš€

More projects