Centipede

Category:Projects | Posted on:February 13, 2025
centipede

This is a simple Centipede game implemented in JavaScript using the HTML5 Canvas API.

Installation

Clone the repository to your local machine:

https://github.com/K8215/centipede.git

Navigate to the project directory:

cd centipede

Open index.html in your web browser to start the game.

Usage

The game starts automatically when you open index.html in your browser.

Gameplay

  • The player can move laterally and shot missiles.
  • The centipede will split when hit with missiles.
  • Mushrooms will make centipedes reverse course. The player can destroy them with missiles.
  • The game ends when the player is hit by a centipede or all of the centipedes are destroyed.

Controls

  • A: Move left
  • D: Move right
  • Space: Shoot missile
  • Enter: Restart game (after game over)

Known Bugs

  • Hit boxes are not perfect. Centipedes sometimes become stuck on the mushrooms and spaz out.
  • Every so often, the number of segments gets lost and the game fails to conclude even if you’ve destroyed all of the segments.