vibe game is a retro-futuristic gaming hub featuring a collection of stunning synthwave and pixel-art games. Race through the cosmos, explore the void, and relive the classic arcade experience with a modern twist.
- Gaming Hub: A central hub to access multiple high-quality retro games with a seamless navigation experience.
- Search & Filter: Easily find your favorite games using the built-in search bar and category filters.
- Favorites System: Save your most-played games to your personal favorites list (persisted via LocalStorage).
- Synthwave Aesthetic: Immersive visuals featuring:
- CRT-style scanline overlays.
- Neon glow effects and pixel-perfect borders.
- Smooth Framer Motion transitions and animations.
- 3D Experiences: High-performance gameplay powered by Three.js and React Three Fiber.
- Responsive Design: Fully optimized for desktop, tablet, and mobile devices with a mobile-first approach.
| Game | Description |
|---|---|
| Cyber Strike | High-octane action in a cyberpunk world. |
| Void Explorer | Journey into the unknown depths of space. |
| Pixel Quest | A classic pixel-art adventure. |
| Synth Racer | Fast-paced racing with a retro vibe. |
| Data Miner | Dive into the digital grid. |
| Gold Miner | Classic mining fun with a modern look. |
| City Brawler | Retro brawler action. |
| Commando Strike | Classic run-and-gun gameplay. |
- Frontend: React 19
- 3D Rendering: Three.js with @react-three/fiber and @react-three/drei
- Styling: Tailwind CSS
- State Management: Zustand
- Routing: React Router
- Animations: Framer Motion
- Icons: Lucide React
- Clone the repository.
- Install dependencies:
npm install
- Start the development server:
npm run dev
This project is licensed under the MIT License.
To ensure high-performance, maintainable, and scalable 2D games, all games in this hub follow our Professional Game Architecture Standard (v1.0).
- Separation of Concerns (SoC): Decoupling UI (React), Logic (Engine), and Data (Store).
- Deterministic Logic: Using a fixed time step (0.016s) for consistent physics across devices.
- Entity-Component-System (ECS) Lite: Objects encapsulate their own state and behavior.
- Event-Driven Communication: Decoupled Engine-to-UI communication via Zustand.
src/games/[game-name]/
โโโ components/ # React UI (HUD, Menus, Overlays)
โโโ core/ # Core Engine & Input Management
โโโ entities/ # Game Objects (Miner, Items)
โโโ systems/ # Global Logic Modules (Particles)
โโโ audio.ts # Sound management
โโโ constants.ts # Game constants
โโโ store.ts # Zustand state management
โโโ types.ts # TypeScript interfaces and types
โโโ [game-name].tsx # Main game component
This document outlines the standard architectural design for all games in this hub, using Gold Miner as the reference implementation. It follows modern software engineering principles and an Object-Oriented Programming (OOP) approach.
The game is built using React for the UI layer, Zustand for global state management, and HTML5 Canvas for the core gameplay rendering. The logic is separated into a dedicated Game Engine that handles physics, collisions, and entity updates.
Located in store.ts, the store acts as the bridge between the React UI and the Game Engine.
- Responsibilities:
- Managing high-level game states (Score, Level, Goal, Time, Status).
- Handling transitions between game screens (Start, Playing, Game Over, Level Clear).
- Providing a hook for the UI to trigger game actions (e.g.,
shootClaw).
The GoldMinerEngine class (extending BaseEngine) is the "brain" of the game.
- Responsibilities:
- Level Generation: Spawning items based on the current level difficulty.
- Update Loop: Calculating physics, checking for collisions between the claw and items.
- Entity Management: Maintaining lists of active items, particles, and floating texts.
- Rendering Orchestration: Calling the
draw()methods of all entities in the correct order. - Input Handling: Polling the centralized
InputManager(core/input.ts) for player actions.
The game uses a class-based system to encapsulate the behavior and appearance of game objects, all extending BaseEntity.
- Miner (
entities/miner.ts): Manages the swinging angle of the claw, claw states (swinging,shooting,retracting), and drawing logic. - Items (
entities/item.ts): Uses aBaseItemabstract class for common properties (x, y, value, weight) and subclasses for specific drawing logic. - Visual Effects (
systems/particles.ts): Handles debris particles and floating text indicators via a dedicatedParticleSystem.
Operates on a standard requestAnimationFrame loop located in GameView.tsx.
- Update Phase:
engine.update(dt)handles physics, collisions, and entity updates. - Draw Phase:
engine.draw(ctx)renders the background, items, miner, and effects in layers.
A centralized audio controller using the Web Audio API with lazy initialization and dynamic pitch/speed adjustment based on item weight.
- Singleton-like Engine: Instantiated once per level and held in the store.
- Strategy Pattern: Different item types implement their own drawing strategies.
- Observer Pattern: The store notifies the UI of state changes.
- Fixed Time Step: Ensures consistent gameplay speed.
This document defines the standard architecture for high-performance, maintainable, and scalable 2D games built with React, TypeScript, and HTML5 Canvas.
- Separation of Concerns (SoC): Presentation (React), Logic (Engine), Data (Store).
- Deterministic Logic: Independent of frame rate (fixed time step).
- Entity-Component-System (ECS) Lite: Objects encapsulate their own state and behavior.
- Event-Driven Communication: Decoupled Engine-to-UI communication.
Every game object must follow: init(), load(), update(dt), draw(ctx), destroy().
- Engine: Pure TypeScript class, not a React component.
- Entity Management: Use Object Pooling for high-frequency objects.
- Input Management: Centralized
InputManagerfor easy remapping. - Asset Loading: Use an
AssetLoaderto ensure resources are ready before the game starts.
- Offscreen Canvas: Render static backgrounds once.
- Layered Rendering: Separate passes for background, midground, foreground.
- Culling: Don't update/draw entities outside the viewport.
- Fixed Time Step: Use
update(0.016)for logic.
- Scalability: Easily add entities.
- Testability: Logic separated from React.
- Portability: Core logic is framework-agnostic.
- Collaboration: Clear separation of concerns for team workflows.