Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ninja Game JS

GitHub repo size GitHub last commit Stars GitHub Pages


JavaScript/HTML5 Canvas Ninja Game, based on the Kodeco (Ray Wenderlich) Cocos2d-x tutorial, rebuilt as a browser game.

Tutorial source: https://www.kodeco.com/1848-cocos2d-x-tutorial-for-beginners


Play Online


Features

  • Monster movement
  • Projectile firing
  • Collision detection
  • Debug mode

Controls

  • Aim: Mouse
  • Fire: Right-Click
  • Debug Toggle: P
  • Music Toggle: M

Tech Stack

  • Vanilla JavaScript (ES Modules)
  • HTML5 Canvas
  • CSS
  • Audio via HTMLAudioElement
  • Texture atlas + plist parsing

Run Locally

Option 1: npm (recommended)

npm install
npm start

Then open: http://127.0.0.1:5500/

Option 2: VS Code Live Server

  1. Open project in VS Code
  2. Run Live Server on index.html
  3. Open in browser

Option 3: Python static server

python -m http.server 5500

Then open: http://127.0.0.1:5500/


Project Structure

assets/
  audio/
    music/
    sfx/
  images/
css/
src/
  audio/
  game.js
  input.js
index.html
package.json

Audio Notes

  • Background music uses assets/audio/music/background-music-aac.mp3.
  • Sound effects are loaded from assets/audio/sfx/.

Screenshots

Gameplay screenshot player Gameplay screenshot moving monsters Gameplay screenshot shooting projectiles Gameplay screenshot debug collisions


Roadmap

  • Sprites
  • Movement
  • Projectiles
  • Collisions and Physics

Related Projects


Credits

  • Original tutorial/game design inspiration: Kodeco / Ray Wenderlich Cocos2d-x Ninja Game tutorial
  • Original C++ versions from Platform Game Development work

About

Ninja Game: JavaScript version of Cocos2d-x tutorial.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages