Skip to content

A small 2D endless runner game built with vanilla JavaScript and HTML5 Canvas

Notifications You must be signed in to change notification settings

ghostmaruko/Endless-Runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿƒ Endless Runner 2D โ€“ JavaScript Canvas Game

A small 2D endless runner game built with vanilla JavaScript and HTML5 Canvas.
The goal is to survive as long as possible by avoiding incoming obstacles while the game gradually increases in difficulty.

This project was developed as a portfolio piece to demonstrate core game development concepts using JavaScript.


๐ŸŽฎ Gameplay

  • The player runs automatically
  • Press Space or Click / Tap to jump
  • Avoid incoming obstacles
  • Game speed and difficulty increase over time
  • The score increases the longer you survive

When you collide with an obstacle, the game ends.
Tap or click the screen to restart.


โœจ Features

  • Custom game loop using requestAnimationFrame
  • Gravity-based jump physics
  • Collision detection (AABB)
  • Dynamic difficulty scaling:
    • Increasing obstacle speed
    • Randomized obstacle spawn timing
  • Time-based score system
  • Clean Game Over overlay rendered directly on canvas
  • Restart without page refresh
  • No external libraries

๐Ÿ›  Tech Stack

  • JavaScript (ES6)
  • HTML5 Canvas
  • CSS (minimal)

๐Ÿ“ธ Screenshots

Gameplay Screenshot Game Over Screenshot GIF


๐Ÿš€ How to Run the Game

  1. Clone the repository:
  1. Open index.html in your browser

No build tools or dependencies required.


๐Ÿ“š What This Project Demonstrates

  • Understanding of game loops and real-time updates
  • Physics simulation basics (gravity and jumping)
  • Object-oriented game architecture
  • Obstacle spawning and cleanup
  • Scalable difficulty progression
  • Clean and readable JavaScript code

๐Ÿ”— Live Demo

https://ghostmaruko.github.io/Endless-Runner/


๐Ÿ“ฑ Responsive Design

The game is fully playable on desktop and mobile devices.
It supports mouse, keyboard, and touch input for a consistent experience across platforms.

Note:

Gameplay speed is frame-based and may vary slightly on lower-FPS devices.

About

A small 2D endless runner game built with vanilla JavaScript and HTML5 Canvas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published