How killedbyapixel/littlejs works
LittleJS is a lightweight HTML5 game engine. A game supplies initialization, update, and render callbacks to the engine; the engine initializes its rendering context and provides input, objects, physics, audio, and graphics capabilities for the game loop. Separate 2D and 3D systems, editors, and optional plugins extend that core. The README documents these capabilities; the sampled excerpts show engine startup initializing WebGL, but do not expose most cross-module calls, so capability links below use README evidence and are not a complete call graph.
Main entry points: engine.js Engine lifecycle · engineDraw.js 2D drawing · render3d.js 3D renderer · engineObject.js Game objects
Components 34
Engine Runtime
- Engine lifecycle
src/engine.js - Input handling
src/engineInput.js - Audio playback
src/engineAudio.js - Debug overlay
src/engineDebug.js
2D World
- Game objects
src/engineObject.js - Tile layers
src/engineTileLayer.js - Particle system
src/engineParticles.js
Graphics
- 2D drawing
src/engineDraw.js - WebGL renderer
src/engineWebGL.js - Post-processing
plugins/postProcess.js - Texture sheets
plugins/textureSheet.js - 2D lighting
plugins/lightSystem.js
3D Systems
- 3D renderer
plugins/render3d.js - 3D objects
plugins/render3dObject.js - 3D meshes
plugins/render3dMesh.js - glTF loading
plugins/gltf.js - 3D effects
plugins/render3dExtras.js - Voxel maps
plugins/render3dVoxels.js - 3D levels
plugins/render3dLevel.js
Plugins and Services
- 2D level editor
src/engineEditor.js - 3D level editor
plugins/render3dEditor.js - Box2D physics
plugins/box2d.js - Box2D WebAssembly
plugins/box2d.wasm.js - A* pathfinding
plugins/pathFinder.js - Parallax layers
plugins/parallax.js - Audio effects
plugins/audioEffects.js - UI widgets
plugins/uiSystem.js - Tweens
plugins/tweenSystem.js - Scene states
plugins/sceneSystem.js - Newgrounds services
plugins/newgrounds.js - Wavedash services
plugins/wavedash.js
Other components
- Game developer
- Newgrounds
- Wavedash
Connections 31
- Game developer → Engine lifecycle: starts game
README.md - Engine lifecycle → WebGL renderer: initializes
src/engine.js - Engine lifecycle → Input handling: provides input
README.md - Engine lifecycle → Audio playback: provides audio
README.md - Engine lifecycle → Game objects: provides objects
README.md - Engine lifecycle → 2D drawing: provides rendering
README.md - Game objects → Tile layers: collides with
README.md - Game objects → Particle system: supports particles
README.md - 2D drawing → WebGL renderer: renders through
src/engineDraw.js - 2D drawing → Post-processing: supports shaders
README.md - 2D drawing → Texture sheets: uses atlases
README.md - 2D drawing → 2D lighting: supports lighting
README.md - Engine lifecycle → Debug overlay: supports overlay
README.md - Game objects → 3D objects: supports 3D objects
README.md - 3D renderer → 3D meshes: draws meshes
README.md - 3D renderer → glTF loading: loads models
README.md - 3D renderer → 3D effects: supports effects
README.md - 3D renderer → Voxel maps: renders voxels
README.md - 3D renderer → 3D levels: loads levels
README.md - 2D level editor → Tile layers: edits maps
src/engineEditor.js - 3D level editor → 3D levels: edits levels
plugins/render3dEditor.js - Game objects → Box2D physics: optional physics
README.md - Box2D physics → Box2D WebAssembly: uses runtime
README.md - Engine lifecycle → A* pathfinding: optional routing
README.md - 2D drawing → Parallax layers: draws backgrounds
README.md - Audio playback → Audio effects: optional effects
README.md - Engine lifecycle → UI widgets: offers widgets
README.md - Engine lifecycle → Tweens: offers easing
README.md - Engine lifecycle → Scene states: supports game states
README.md - Newgrounds services → Newgrounds: connects to
README.md - Wavedash services → Wavedash: connects to
README.md