• Stars
    star
    3,261
  • Rank 13,776 (Top 0.3 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 3 years ago
  • Updated about 1 month 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,570
star
2

ZzFX

A Tiny JavaScript Sound FX System
JavaScript
574
star
3

OS13k

A Tiny OS and Mini Game Engine
JavaScript
523
star
4

HueJumper2k

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

SpaceHuggers

A roguelike platformer with destructible environments in 13KB of JavaScript
JavaScript
267
star
6

BounceBack

Boomerang Zelda Homage for JS13k
JavaScript
228
star
7

1Keys

A 1 Kilobyte JavaScript Piano
JavaScript
145
star
8

ZzSprite

Pixel Art Sprite Generator
JavaScript
137
star
9

ZzArt

Abstract Art Evolved
JavaScript
109
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
81
star
12

TinySki

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

Drive13K

DR1V3N WILD - Arcade style 3D driving game in only 13 kilobytes
JavaScript
47
star
14

generative

Generative Art by Frank Force
HTML
20
star
15

NoteCraft

Cellular Automata Music Game
JavaScript
20
star
16

EggTimeRewind

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

FrankEngine

Game Engine and Level Editor
C++
13
star
18

newgrounds

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

Buddhabrot

A JavaScript Buddhabrot Renderer
JavaScript
9
star
20

VidScreen

VidScreen Emulator and Live Editor
HTML
5
star
21

EggTimeRewind13k

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

LudumDare44

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

KilledByAPixel.github.io

1
star