Skip to content

didifive/jungle-game-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jungle Infinite Runner

License React Redux Vite Netlify Status

A modern infinite runner game built with React, Redux, and Vite

Live Demo · Report Bug · Request Feature


📋 Table of Contents


🎮 About

Jungle Infinite Runner is a modern browser-based infinite runner game developed as part of the Digital Innovation One Bootcamp - Impulso React Web Developer, under the guidance of Celso Henrique.

This project evolved from a Chrome's dinosaur game recreation (original project) into a fully-featured game with modern React architecture, state management, and responsive design.

The main goal was to migrate from vanilla JavaScript to a comprehensive React application using Vite, Redux, and styled-components, demonstrating advanced concepts such as hooks, global state management, conditional rendering, and game loop implementation.


✨ Features

  • Modern Build Tool: Built with Vite for fast development and optimized production builds
  • 🎯 State Management: Redux-powered centralized state management
  • 🎨 Styled Components: Dynamic styling with styled-components
  • 📱 Responsive Design: Fully responsive with support for desktop and mobile devices
  • 🎮 Multiple Input Methods: Keyboard (spacebar) and touchscreen support
  • 🎵 Sound System: Background music and sound effects with toggle controls
  • 💾 Persistent High Scores: LocalStorage integration for record tracking
  • 🌍 Parallax Background: Multi-layer parallax effect for immersive experience
  • 👾 Multiple Enemy Types: Three different enemy types (Goblin, Mushroom, Skeleton)
  • ❤️ Life System: Health point management with visual feedback
  • 📊 Score System: Real-time score tracking with high score records
  • 🔄 Dynamic Difficulty: Adaptive difficulty based on enemy count

🛠 Technologies

Core Technologies

Additional Libraries

Design Resources

Assets


🏗 Architecture

Project Structure

src/
├── components/          # Reusable UI components
│   ├── GlobalStyles/   # Global styling
│   ├── Modal/          # Modal component
│   └── Notice/         # Notice component
├── containers/         # Container components
│   ├── App/           # Root application container
│   ├── Game/          # Game container and logic
│   ├── Hud/           # Heads-Up Display
│   └── Scenario/      # Game scenario and background
├── hooks/             # Custom React hooks
│   ├── useGameLogic.jsx
│   └── useGameLoop.jsx
└── store/             # Redux store
    ├── actions/       # Action creators
    └── reducers/      # State reducers

Component Breakdown

Root Components

  • GlobalStyles: Global CSS styles using styled-components
  • Modal: Reusable modal component for Info and Game Over screens
  • Notice: Information notices for game controls

Game Container

  • Character: Player character with jump mechanics
  • Controls: Display available game commands
  • Enemies: Enemy management with three enemy types
  • Header: Game header display
  • Info: Modal panel for game information and Game Over state

HUD (Heads-Up Display)

  • Life: Health point display and management
  • Record: High score display
  • Score: Current score tracking and display

Scenario

  • BackgroundParalax: 4-layer parallax background effect
  • Ground: Ground layer for the game scenario

State Management

Redux store with the following reducers:

  • characterReducer: Character state and jump mechanics
  • enemyReducer: Enemy spawning and movement
  • gameReducer: Overall game state (running, paused, game over)
  • lifeReducer: Player health management
  • scoreReducer: Score tracking and high score management
  • soundsReducer: Audio settings and controls

Key Features Implementation

  • Event Handlers: keyup and touchend events for cross-device compatibility
  • Conditional Rendering: Dynamic component rendering based on game state
  • Dynamic Rendering: .map() method for multiple simultaneous enemy rendering
  • Responsive Design: Viewport-based units (vh, vw, em) and media queries
  • LocalStorage: Persistent high score storage
  • Reset Actions: Game state reset functionality for replay capability

🚀 Getting Started

Prerequisites

  • Node.js 14.18.1 LTS or higher
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone https://github.com/didifive/jungle-game-react.git
    cd jungle-game-react
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Open your browser

    Navigate to http://localhost:3000 (or the port shown in your terminal)

Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build

📖 Game Story

Josué, a humble fisherman, was peacefully fishing when the calmness lulled him to sleep. Suddenly, he awakens to find himself alone in the middle of a dense jungle. As a wolf howls and an owl hoots in the distance, fear grips him. Unarmed and alone, he begins to run without knowing which direction to take or what dangers lie ahead...

Will you help Josué survive the jungle?


💻 Development

Development Setup

This project was developed with:

  • IDE: Visual Studio Code 1.61.2
  • Node.js: 14.18.1 LTS
  • Build Tool: Vite 5.4.6

Migration from Create React App

This project was successfully migrated from Create React App (deprecated) to Vite, resulting in:

  • Faster development server startup
  • Near-instant hot module replacement (HMR)
  • Optimized production builds
  • Better developer experience

🙏 Credits

Original Project

Based on dio-dino-game by Celso Henrique

Bootcamp

Developed as part of the Impulso React Web Developer Bootcamp by Digital Innovation One

Graphics & Assets

Sound Effects

All sound effects from freesound.org:

Tools & Services


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by Luis Carlos Zancanela

GitHub LinkedIn