Skip to content

KilledByAPixel/LittleJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

LittleJS - The Tiny Fast JavaScript Game Engine

LittleJS Logo

NPM Package Build Size NPM Downloads DeepScan Discord

๐Ÿš‚ 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 rendering, physics, particles, sound, and input handling. The code is very clean and well documented with many examples to get you started quickly.

LittleJS Screenshot

LittleJS Features

โœจ Graphics

  • Super fast WebGL2 + Canvas2D hybrid rendering system
  • 100K+ sprites at 60fps
  • Apply Shadertoy style shaders for post-processing effects
  • Robust particle effect system and effect design tool

๐Ÿ”Š Audio

  • Sound and music with mp3, ogg, wave, or ZzFXM
  • Use ZzFX sound effect generator to play sounds without asset files
  • Positional sound effects with distance falloff

๐ŸŽฎ Input

  • Comprehensive input handling for mouse, keyboard, gamepad, and touch
  • Touch pad acts as a mouse with no additional code
  • Customizable on screen gamepad designed for mobile devices

๐Ÿ’ฅ Physics

  • Robust arcade physics system with collision handling
  • Fast tilemap collision with raycasting
  • Full Box2D integration for more realistic physics

๐Ÿš€ Flexibility

  • Compatible with all modern web browsers, operating systems, and mobile devices
  • TypeScript and Module support with example projects for both
  • Ideal for size coding competitions like Js13kGames
  • Open Source and MIT licensed

๐Ÿ› ๏ธ Developer Tools

  • Live example browser with code editor
  • Debug primitive rendering system
  • Screenshot and video capture tools
  • Node.js build system
  • Medal tracking system with Newgrounds support

How To Use LittleJS

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

You will need to run a local web server to run LittleJS games during development! 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

LittleJS comes with a several demos both for learning and using as starter projects to create new games.

Builds

File Mode Module Use case
littlejs.js Debug No Debug mode with asserts
littlejs.release.js Release No Optimized for release
littlejs.min.js Release No Optimized for release and minified
littlejs.esm.js Debug ESM Debug mode with asserts
littlejs.esm.min.js Release ESM Optimized for release and minified

Games Made With LittleJS

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

LittleJS Screenshot

LittleJS Logo