• Stars
    star
    2,901
  • Rank 15,565 (Top 0.4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

LittleJS is a fast HTML5 game engine with many features and no dependencies. 🚂 Choo-Choo!

LittleJS Logo LittleJS - The Tiny JavaScript Game Engine That Can

All aboard!

LittleJS is a super lightweight JavaScript game engine with a fast hybrid rendering system. It provides a comprehensive set of tools including rendering, physics, particles, sound effects, music, input handling, and debug tools. The code is very clean and well documented with a variety of examples to get you started. Choo-Choo! 🚂

LittleJS Screenshot

Examples

Starter Project - Clean demo with only a few things to get you started

Puzzle Game - Match 3 puzzle game with HD rendering and high score tracking

Platformer - Platformer/shooter with procedural generation and destruction

Breakout - Breakout game with post processing effect

Stress Test - Max sprite/object test and music system demo

Particle System Designer - Particle system editor and visualizer

Features

  • Very small footprint with no dependencies
  • Can update and render 10,000+ objects at 60fps, often many times more
  • Object oriented system with fast 2D physics and collision handling for axis aligned boxes
  • Positional audio effects with ZzFX and music with ZzFXM, mp3s, or wavs
  • Input processing system with keyboard, mouse, gamepad, and touch support
  • Particle effects system (particle editor/designer in progress)
  • Medal system tracks and displays achievements with Newgrounds integration
  • Several easy to understand example projects you can build on
  • Apply Shadertoy compatible shaders for post processinge effects
  • Debug tools and debug rendering system
  • Full documentation automatically generated from the source code block tags with JSDoc
  • Build system automatically combines everything, minifies, and removes unused code
  • For size coding competitions like js13kGames, starter project builds to a 7KB zip file
  • Easily build a Windows executable with Electron for distribution on platforms like Steam
  • Open Source with the MIT license so it can be used for anything you want
  • Can be imported as a JavaScript module and includes an example module project
  • Compatible with TypeScript and includes an example TS project

Builds

To easily include LittleJS in your game, you can use one of the 3 pre-built js files. These are also built automatically by the build scripts.

LittleJS can also be imported as a module. There are two module flavors that are automatically built.

There is an enginebuild.bat file included that will rebuild the engine files. The starter project example also includes a batch file build.bat that compresses everything into a tiny zip file using Google Closure, UglifyJS, Roadroller, and ECT. You must first run npm install to setup the necessary npm dependencies.

Tutorial

Debugging

Debug builds of LittleJS have a special menu that can be opened by pressing ~, the tilde key.

  • ~: Debug Overlay
  • 1: Debug Physics
  • 2: Debug Particles
  • 3: Debug Gamepads
  • 4: God Mode
  • 5: Save Screenshot

Simple Code

This engine is made with simplicity in mind using simple and easy to read code. There are only a few files used by the entire engine.

Optional Components, these components are built to synergize with the rest of the engine but are not necessary.

Games Made With LittleJS

Here are a few of the amazing games people are making with LittleJS.

LittleJS Logo

More Repositories

1

JSONCrush

Compress JSON into URL friendly strings
JavaScript
1,555
star
2

ZzFX

A Tiny JavaScript Sound FX System
JavaScript
532
star
3

OS13k

A Tiny OS and Mini Game Engine
JavaScript
521
star
4

HueJumper2k

2 Kilobyte 3D racing game in JavaScript
JavaScript
319
star
5

BounceBack

Boomerang Zelda Homage for JS13k
JavaScript
227
star
6

SpaceHuggers

A roguelike platformer with destructible environments in 13KB of JavaScript
JavaScript
212
star
7

1Keys

A 1 Kilobyte JavaScript Piano
JavaScript
144
star
8

ZzSprite

Pixel Art Sprite Generator
JavaScript
130
star
9

ZzArt

Abstract Art Evolved
JavaScript
106
star
10

Dual-Axis-Illusion

Best Illusion of The Year 2019 - First Place Winner
JavaScript
102
star
11

TinyCode

Some of my best size coding releases
JavaScript
78
star
12

TinySki

Business card size skiing game in C++
C++
47
star
13

generative

Generative Art by Frank Force
HTML
20
star
14

NoteCraft

Cellular Automata Music Game
JavaScript
19
star
15

EggTimeRewind

An procedural shooter in the style of an old Nokia phone
JavaScript
18
star
16

FrankEngine

Game Engine and Level Editor
C++
13
star
17

newgrounds

A Small JavaScript Wrapper for Newgrounds API 3.0
JavaScript
10
star
18

Buddhabrot

A JavaScript Buddhabrot Renderer
JavaScript
9
star
19

VidScreen

VidScreen Emulator and Live Editor
HTML
5
star
20

EggTimeRewind13k

Egg Cracking 13k Lo-Fi Sci-Fi Shooter With Time Travel
JavaScript
5
star
21

LudumDare44

SPENDOTRON: 2019 - Twin stick shooter for Ludum Dare 44
JavaScript
3
star
22

Drive13K

DR1V3N WILD - An outrun inspired driving game in 13 kilobytes
JavaScript
1
star
23

KilledByAPixel.github.io

1
star