A starter framework for getting started with
canvas game development
I've been working with
This is by no means meant to be a complete framework, but rather a way to start experimenting and get your feet wet. There are core classes missing for things like Sprites and Tweens.
The Sample Game
The example I've created is a bare-bones Galaga-esque space shooter. Right now, the game runs infinitely. You can blast bugs until your ship collides with one and the game resets.
Sweet game illustrations by Joseph Le
It is crucial to be as organized as possible. Game JS can get HUGE and nigh impossible to navigate if you're not careful. Break your code out into logical chucks and separate files and folders. Helps you to keep your methods focused and specific, focusing on one concern at a time. Refactor often.
Here's my current setup:
- All the core game engine logic. The logic in these files are completely game agnostic. You should be able to build any game on top of them.
- These are reusable classes you may want to extend to create your game objects.
- If you want to add a new game, create a folder with your game files here
- An example game, ready to be hacked on.
init.js This is where you create the game to be loaded into index.html