Skip to content

Isuru-Eranda/2D-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

The Red Hat Boy - 2D Game

A fun and engaging 2D side-scrolling runner game built with HTML5, CSS3, and JavaScript. Control the Red Hat Boy as he runs through a challenging landscape, jumping over flames to survive and achieve the highest score possible!

๐ŸŽฎ Game Features

  • Smooth Character Animation: Fluid running, jumping, and death animations
  • Dynamic Obstacles: Flame obstacles that move across the screen
  • Progressive Difficulty: Obstacle spacing changes as you advance
  • Score System: Earn points for survival time
  • Sound Effects: Immersive audio for running, jumping, and game events
  • Win Condition: Reach a score of 630 to win the game
  • Responsive Controls: Simple keyboard controls for easy gameplay

๐Ÿ•น๏ธ How to Play

Controls

  • ENTER: Start the game
  • SPACEBAR: Jump over obstacles

Objective

  • Keep the Red Hat Boy alive by jumping over flames
  • Survive as long as possible to achieve a high score
  • Reach 630 points to win the game!

Gameplay Tips

  • Time your jumps carefully to avoid the flames
  • The game gets progressively challenging with varying obstacle patterns
  • Listen for audio cues to enhance your gaming experience

๐Ÿš€ Getting Started

Prerequisites

  • A modern web browser (Chrome, Firefox, Safari, Edge)
  • No additional installations required

How to Run

  1. Clone or download this repository
  2. Open index.html in your web browser
  3. Press ENTER to start the game
  4. Use SPACEBAR to jump and avoid obstacles

๐Ÿ“ Project Structure

2D-Game/
โ”œโ”€โ”€ index.html          # Main HTML file
โ”œโ”€โ”€ style.css           # Game styling and layout
โ”œโ”€โ”€ script.js           # Game logic and mechanics
โ”œโ”€โ”€ Icons/
โ”‚   โ””โ”€โ”€ Icon.png        # Game favicon
โ”œโ”€โ”€ Images/
โ”‚   โ”œโ”€โ”€ background.png  # Game background
โ”‚   โ””โ”€โ”€ Game Over Background.jpg
โ”œโ”€โ”€ Run (1-8).png       # Running animation sprites
โ”œโ”€โ”€ Jump (1-12).png     # Jumping animation sprites
โ”œโ”€โ”€ Dead (1-10).png     # Death animation sprites
โ”œโ”€โ”€ flame.gif           # Obstacle animation
โ”œโ”€โ”€ run.mp3            # Running sound effect
โ”œโ”€โ”€ jump.mp3           # Jumping sound effect
โ”œโ”€โ”€ dead.mp3           # Death sound effect
โ””โ”€โ”€ README.md          # This file

๐ŸŽจ Game Assets

The game includes high-quality sprite animations and sound effects:

  • Character Sprites: 8-frame running animation, 12-frame jumping animation, 10-frame death animation
  • Sound Effects: Authentic audio feedback for all game actions
  • Visual Effects: Animated flame obstacles and scrolling background

๐Ÿ† Scoring System

  • Continuous Scoring: Earn 2 points every 100ms while alive
  • Victory Score: Reach 630 points to win
  • High Score: Try to beat your personal best!

๐Ÿ› ๏ธ Technical Details

  • Built with: Vanilla HTML5, CSS3, and JavaScript
  • Animation: CSS sprite-based character animations
  • Audio: HTML5 Audio API for sound effects
  • Responsive: Optimized for desktop browsers

๐ŸŽฏ Game States

  1. Start Screen: Welcome screen with instructions
  2. Gameplay: Active running and jumping phase
  3. Game Over: Death screen with score and retry option
  4. Victory: Win screen for achieving the target score

๐Ÿ”„ Future Enhancements

Potential improvements for future versions:

  • Multiple levels with different themes
  • Power-ups and special abilities
  • Leaderboard system
  • Mobile touch controls
  • Additional character customization

๐Ÿค Contributing

Feel free to fork this project and submit pull requests for improvements!


Enjoy playing The Red Hat Boy Game. ๐ŸŽฎ๐Ÿƒโ€โ™‚๏ธ๐Ÿ”ฅ

About

๐ŸŽฎ The Red Hat Boy - A fun 2D side-scrolling runner game built with HTML5, CSS3 & JavaScript. Jump over flames, survive as long as possible, and aim for the high score! ๐Ÿƒโ€โ™‚๏ธ๐Ÿ”ฅ

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors