LittleJS

LittleJS - The Tiny Fast JavaScript Game Engine

![LittleJS Screenshot](/LittleJS/examples/logo.png) [![NPM Package][npm]][npm-url] [![Build Size][build-size]][build-size-url] [![NPM Downloads][npm-downloads]][npmtrends-url] [![DeepScan][deepscan]][deepscan-url] [![Discord][discord]][discord-url]

🚂 All aboard!

LittleJS is a fast, lightweight, and fully open source HTML5 game engine designed for simplicity and performance. Its small footprint is packed with a comprehensive feature set including hybrid rendering, physics, particles, sound, and input handling. The code is clean and well documented with some fun examples to get you started right away. Choo-Choo!

🚀 Join the LittleJS Game Jam

The Second Annual LittleJS Game Jam will take place From Oct 3 to Nov 3! Unleash your creativity and develop amazing games using the LittleJS game engine. 🕹️🎮 Sign up today and get more info about the jam on itch.io!

## [Demo](https://killedbyapixel.github.io/LittleJS/examples/starter/) | [Docs](https://killedbyapixel.github.io/LittleJS/docs) | [Trailer](https://youtu.be/chuBzGjv7Ms) | [Discord](https://discord.gg/zb7hcGkyZe) | [Tutorial](https://github.com/KilledByAPixel/LittleJS/blob/main/examples/breakoutTutorial/README.md) | [FAQ](https://github.com/KilledByAPixel/LittleJS/blob/main/FAQ.md)

LittleJS Screenshot

About LittleJS Engine

LittleJS is a small but powerful game engine with many features and no dependencies.

✨ Graphics

🔊 Audio

🎮 Input

💥 Physics

🚀 Flexibility

🛠️ And more…

How To Use LittleJS

To get started download the latest LittleJS package from GitHub or install via npm: npm install littlejsengine

You need to run a local web server to run LittleJS games during development! You may see a console error like “The image element contains cross-origin data.” Don’t panic, it’s easy to fix! If you are using Visual Studio Code there is a Live Preview Extension that will handle this for you automatically. Another option is to setup a simple local web server like http-server via npm.

Examples

These demos are for both learning and using as starter projects to create your own games.

Builds

To easily include LittleJS in your game, you can use one of the pre-built js files.

To rebuild the engine you must first run npm install to setup the necessary npm dependencies. Then call npm run build to build the engine.

The starter example project includes a node js file build.js that compresses everything into a tiny zip file using Google Closure, UglifyJS, and ECT Zip.

Games Made With LittleJS

Here are a few of the many amazing games created with LittleJS…

LittleJS Logo