A 2d HTML5 Canvas game engine
Splat ECS is a 2d game engine made for creating multi-platform games entirely in JavaScript. Splat ECS is built around the Entity Component System pattern, which is flexible and promotes composition of behaviors.
- Rectangles!
- Keyboard, mouse, touch, & gamepad input
- Sounds and music (Web Audio API and HTML5 Audio)
- Sprite animation
- Asset loading, and built-in loading screen
- Games work well on phones, tablets, and desktop browsers.
- A* Pathfinding
- Particles
- SCREENSHAKE
- Tiled map editor support
- Easing
- Chrome (desktop & mobile)
- Firefox
- Internet Explorer (desktop & mobile)
- Safari (desktop & mobile)
- Mac using Electron
- Linux x64 using Electron
- Chrome Web Store (currently broken see issue #69)
- Android using Cordova
Splat now works in Cordova, and due to updates to recent phone browsers we have seen good framerates on Android in google Chome. We have not tested Cordova builds on iOS yet, please let us know what you find out.
- Browser (like Firefox or Chrome)
- Text editor
- Terminal
- Node.js
Create a file named game.js and start your game with this code:
"use strict";
var Splat = require("splat");
var canvas = document.getElementById("canvas");
var manifest = {
"images": {},
"sounds": {},
"fonts": {},
"animations": {}
};
var game = new Splat.Game(canvas, manifest);
game.scenes.add("title", new Splat.Scene(canvas, function() {
// Initiaization
},function(elapsedMillis) {
// Simulation
}, function(context) {
// Draw
}));
game.scenes.switchTo("loading"); // Start loading scene which will switch to 'title' scene when all the assets in manifest are loaded.
Install browserify
$ npm install --save-dev browserify
Then use browserify to bundle your game as a single JavaScript file for the browser.
$ browserify game.js -o index.js
Include canvas element with id "canvas" and bundled JavaScript file (Splat + Game) on your html page:
<canvas id="canvas" width="1136" height="640"></canvas>
<script type="text/javascript" src="index.js"></script>
- Cluster Junk
- Cali Bunga
- Flip Flap Pong
- Polymorphic
- Electropolis
- Morning Ritual
- Drunken Boss Fight
- Zen Madness
- Treatment and Control
- The Day the World Changed
- Uprooted
See more Splat games at http://splatjs.com/
Send a pull request to add your game to the list!
If you are interested in participating in this project, please read CODE_OF_CONDUCT.md for details on our code of conduct.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Eric Lathrop - Initial work
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.TXT file for details