HTML5 Game Library with a Focus on Ease of Learning
npm install jetcode-scrubjsThe architecture and naming system are inspired by Scratch, a popular visual programming environment, making ScrubJS intuitive for beginner developers.
The library is designed to provide a simple and accessible way to learn the fundamentals of game development, such as:
* Game loop
* Sprite management
* Event handling
* Animation
* Collisions
* Multi-scene support
* Built-in collider system and touch detection
* Easy handling of sounds, costumes, and layers
* Debugging tools and collider visualization
* Error display with hints
``javascript
const game = new Game(800, 600);
const stage = new Stage();
const cat = new Sprite();
cat.addCostume("cat.png");
stage.forever(() => {
cat.move(5);
cat.bounceOnEdge();
});
game.run();
``
* Core Game Objects
* Game Object
* Stage
* Sprite Object
* Game Loop
* Movement, rotation, coordinates
* Pivot point
* Determining the distance between a sprite and another object
* Costumes and animation
* Layers
* Drawing capabilities
* In-game sounds
* Colliders, touches, and tags
* Multi-scene games
* Visual effects: opacity and CSS filters
* Composite sprites
* Debugging and performance