littlejsengine 1.18.29 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/FAQ.md +841 -815
  2. package/README.md +211 -199
  3. package/dist/littlejs.d.ts +4383 -812
  4. package/dist/littlejs.esm.js +31848 -16680
  5. package/dist/littlejs.esm.min.js +14 -1
  6. package/dist/littlejs.js +31230 -16166
  7. package/dist/littlejs.min.js +13 -1
  8. package/dist/littlejs.release.js +27419 -15457
  9. package/package.json +10 -5
  10. package/plugins/audioEffects.js +375 -0
  11. package/plugins/box2d.js +2516 -2073
  12. package/plugins/drawUtilities.js +206 -31
  13. package/plugins/gltf.js +740 -0
  14. package/plugins/jsconfig.json +19 -0
  15. package/plugins/lightSystem.js +719 -330
  16. package/plugins/math3d.js +911 -0
  17. package/plugins/medalSystem.js +118 -72
  18. package/plugins/newgrounds.js +400 -199
  19. package/plugins/pathFinder.js +208 -175
  20. package/plugins/pluginExport.js +196 -115
  21. package/plugins/postProcess.js +284 -166
  22. package/plugins/render3d.js +4072 -0
  23. package/plugins/render3dDebug.js +109 -0
  24. package/plugins/render3dExtras.js +1754 -0
  25. package/plugins/render3dVoxels.js +502 -0
  26. package/plugins/textureSheet.js +86 -48
  27. package/plugins/threejs.js +183 -158
  28. package/plugins/tweakables.js +411 -0
  29. package/plugins/tweenSystem.js +646 -526
  30. package/plugins/uiSystem.js +2024 -1687
  31. package/plugins/zzfxm.js +8 -15
  32. package/src/engine.js +345 -194
  33. package/src/engineAudio.js +1022 -777
  34. package/src/engineBuild.mjs +289 -253
  35. package/src/engineDebug.js +912 -735
  36. package/src/engineDraw.js +1774 -1510
  37. package/src/engineEditor.js +2431 -0
  38. package/src/engineExport.js +419 -396
  39. package/src/engineInput.js +1462 -1293
  40. package/src/engineLogo.js +4 -3
  41. package/src/engineMath.js +1274 -1183
  42. package/src/engineObject.js +674 -551
  43. package/src/engineParticles.js +583 -532
  44. package/src/engineRelease.js +67 -45
  45. package/src/engineSettings.js +808 -726
  46. package/src/engineTileLayer.js +995 -741
  47. package/src/engineUtilities.js +32 -13
  48. package/src/engineWebGL.js +1162 -941
  49. package/src/jsconfig.json +17 -13
  50. package/plugins/box2d.wasm.js +0 -630
  51. package/plugins/box2d.wasm.wasm +0 -0
package/README.md CHANGED
@@ -1,199 +1,211 @@
1
- # LittleJS - The Tiny Fast JavaScript Game Engine
2
-
3
- <div align='center' markdown='1'>
4
-
5
- ![LittleJS Logo](examples/logo.png)
6
-
7
- [![NPM Package][npm]][npm-url]
8
- [![Build Size][build-size]][build-size-url]
9
- [![NPM Downloads][npm-downloads]][npmtrends-url]
10
- [![DeepScan][deepscan]][deepscan-url]
11
- [![MIT License][license]][license-url]
12
- [![Discord][discord]][discord-url]
13
-
14
- </div>
15
-
16
- ## 🚂 All Aboard!
17
-
18
- LittleJS is a fast, lightweight, and fully open source HTML5 game engine designed for simplicity and performance.
19
- Its small footprint is packed with a comprehensive feature set including rendering, physics, particles, sound, and input handling.
20
- The code is very clean and well documented with many examples to get you started quickly.
21
-
22
- ### 🚀 [Join the LittleJS Game Jam](https://itch.io/jam/littlejs-jam)
23
-
24
- *The Third Annual LittleJS Game Jam will take place From Oct 2 to Nov 2! Unleash your creativity and develop amazing games using the LittleJS game engine.*
25
-
26
- ### 😼👍 [LittleJS + JS13k](https://github.com/KilledByAPixel/LittleJS/tree/js13k) - We made a special branch designed for size coding events like JS13k.
27
-
28
- <div align='center' markdown='1'>
29
-
30
- ## [Demos](https://killedbyapixel.github.io/LittleJS/examples) | [Arcade](https://killedbyapixel.github.io/LittleJSArcade) | [Docs](https://killedbyapixel.github.io/LittleJS/docs) | [FAQ](https://github.com/KilledByAPixel/LittleJS/blob/main/FAQ.md) | [Trailer](https://youtu.be/chuBzGjv7Ms) | [Discord](https://discord.gg/zb7hcGkyZe)
31
-
32
- </div>
33
-
34
- ![LittleJS Screenshot](examples/screenshot.jpg)
35
-
36
- ## LittleJS Features
37
-
38
- ### ✨ Graphics
39
-
40
- - Blazing fast WebGL2 + Canvas2D hybrid rendering system
41
- - Apply [Shadertoy](https://www.shadertoy.com) style shaders for post-processing effects
42
- - Robust particle effect system and [effect design tool](https://killedbyapixel.github.io/LittleJS/examples/particles/)
43
- - Load sprites and animations into texture sheets at runtime, or import [TexturePacker](https://www.codeandweb.com/texturepacker) and [Aseprite](https://www.aseprite.org) atlases
44
- - Optional 3D rendering with the [Three.js](https://threejs.org) plugin
45
-
46
- ### 🔊 Audio
47
-
48
- - Sound and music with mp3, ogg, or wave files
49
- - Use [ZzFX](https://killedbyapixel.github.io/ZzFX/) sound generator to play sounds without asset files
50
- - Spatial audio stereo panning
51
-
52
- ### 🎮 Input
53
-
54
- - Comprehensive input handling for mouse, keyboard, gamepad, and touch
55
- - Customizable on screen gamepad designed for mobile devices
56
-
57
- ### 💥 Physics
58
-
59
- - Robust arcade physics system with collision handling
60
- - Fast tilemap collision and raycasting
61
- - Full Box2D integration for realistic physics using [Box2D v2.3.1 wasm](https://github.com/kripken/box2d.js)
62
- - Grid-based A* pathfinding plugin with optional path smoothing
63
-
64
- ### 🚀 Flexibility
65
-
66
- - Compatible with all modern web browsers and mobile devices
67
- - Full TypeScript and Module support with example projects for both
68
- - [Vite](https://vite.dev) starter template for instant dev server with hot reload
69
- - Great for size coding competitions like [Js13kGames](https://js13kgames.com/)
70
- - Open Source and [MIT licensed](https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE)
71
-
72
- ### 🛠️ Developer Tools
73
-
74
- - Live example browser with code editor
75
- - Import level editor data from [Tiled](https://github.com/mapeditor/tiled) or other JSON
76
- - Debug overlay and primitive rendering system
77
- - Medal tracking system with [Newgrounds](https://www.newgrounds.com/) support
78
- - Node.js build system
79
-
80
- ### 🤖 AI Friendly
81
-
82
- - The entire API is small and well documented so LLMs can produce high quality results
83
- - [LittleJS AI Tools](https://github.com/KilledByAPixel/LittleJS-AI) - Templates, examples, and prompts tuned for AI + LittleJS workflows
84
- - [LittleJS GPT](https://chatgpt.com/g/g-67c7c080b5bc81919736bc8815836be6-littlejs-game-maker) - Build LittleJS games right inside ChatGPT
85
-
86
- ### 🧊 3D with Three.js
87
-
88
- - Optional [Three.js](https://threejs.org) plugin renders a 3D scene behind the LittleJS canvas
89
- - 2D camera and 3D camera stay aligned so sprites and meshes share the same world space
90
- - LittleJS physics drive Three.js meshes with `ThreeJSObject`
91
-
92
- ## How To Use LittleJS
93
-
94
- To get started download the latest LittleJS package from GitHub or install via npm:
95
-
96
- ```
97
- npm install littlejsengine
98
- ```
99
-
100
- or use `degit` for an empty Vite template
101
-
102
- ```
103
- npx degit KilledByAPixel/LittleJS/examples/vite-starter my-game
104
- cd my-game
105
- npm install
106
- npm run dev
107
- ```
108
-
109
- Here is a minimal Hello World example game.
110
-
111
- ```html
112
- <!DOCTYPE html>
113
- <script src="../dist/littlejs.js"></script>
114
- <script>
115
- function gameInit() {}
116
- function gameUpdate() {}
117
- function gameUpdatePost() {}
118
- function gameRender() {}
119
- function gameRenderPost() { drawTextScreen('Hello World!', mainCanvasSize.scale(.5), 80); }
120
- engineInit(gameInit, gameUpdate, gameUpdatePost, gameRender, gameRenderPost);
121
- </script>
122
- ```
123
-
124
- ## Tutorials
125
-
126
- - [Making Awesome Games With LittleJS](https://youtu.be/_dXKU0WgAj8?si=ZDXLYAFDWp54hrGT) - A short talk about LittleJS with some tips on how to use it.
127
- - [Tutorial: Breakout](https://github.com/KilledByAPixel/LittleJS/tree/main/examples/breakoutTutorial) - Learn how to make a simple game from scratch
128
- - [Tutorial: Make a ski game](https://eoinmcgrath.com/little-ski/tutorial.html) - This tutorial by eoinmcg that shows how to make a pixel art style game.
129
- - [LittleJS Quick Reference Sheet](https://github.com/KilledByAPixel/LittleJS/blob/main/REFERENCE.md) - A reference sheet to help you get started.
130
- - [Little JS FAQ](https://github.com/KilledByAPixel/LittleJS/blob/main/FAQ.md) - Answers to common questions about LittleJS.
131
- - [JS13k Branch](https://github.com/KilledByAPixel/LittleJS/tree/js13k) - For size coding events like JS13k there is a special branch that builds to a 7KB zip.
132
-
133
- ## Examples
134
-
135
- LittleJS comes with several demos both for learning and using as starter projects to create new games.
136
-
137
- - [Example Browser](https://killedbyapixel.github.io/LittleJS/examples/) - Live example browser with all examples and editable source
138
- - [LittleJS Arcade](https://killedbyapixel.github.io/LittleJSArcade/) - Over 50 example games you can use as starter projects
139
- - [Short Examples](https://github.com/KilledByAPixel/LittleJS/tree/main/examples/shorts) - 60+ single-file demos showing off individual engine features
140
- - [Breakout](https://killedbyapixel.github.io/LittleJS/examples/breakout/) - Block breaking game with post-processing effects
141
- - [Puzzle Game](https://killedbyapixel.github.io/LittleJS/examples/puzzle/) - Match 3 puzzle game with HD rendering and high score tracking
142
- - [Platformer](https://killedbyapixel.github.io/LittleJS/examples/platformer/) - Platformer/shooter demo that loads level data
143
- - [Box2D Demo](https://killedbyapixel.github.io/LittleJS/examples/box2d/) - Box2D plugin demonstration and testbed
144
- - [Three.js Side Scroller](https://killedbyapixel.github.io/LittleJS/examples/threejs/sideScroller/) - 3D rendering with Three.js behind the 2D canvas
145
- - [Three.js Platformer](https://killedbyapixel.github.io/LittleJS/examples/threejs/platformer/) - 3D platformer with LittleJS gameplay and Three.js rendering
146
- - [Stress Test](https://killedbyapixel.github.io/LittleJS/examples/stress/) - Sprite rendering benchmark and music system demo
147
- - [Particle System Designer](https://killedbyapixel.github.io/LittleJS/examples/particles/) - Particle system editor and visualizer
148
-
149
- ## Builds
150
-
151
- | File | Mode | Module | Use case |
152
- |------|------|--------|----------|
153
- | [littlejs.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.js) | Debug | No | Debug mode with asserts |
154
- | [littlejs.release.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.release.js) | Release | No | Optimized for release |
155
- | [littlejs.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.min.js) | Release | No | Optimized for release and minified |
156
- | [littlejs.esm.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.esm.js) | Debug | ESM | Debug mode with asserts |
157
- | [littlejs.esm.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.esm.min.js) | Release | ESM | Optimized for release and minified |
158
-
159
- ## Games Made With LittleJS
160
-
161
- Here are a few of the many amazing games created with LittleJS...
162
-
163
- - [Space Huggers](https://www.newgrounds.com/portal/view/819609) - Roguelike platformer shoot-em-up game with procedural levels. by [KilledByAPixel](https://frankforce.com/)
164
- - [Black Cat Squadron](https://js13kgames.com/games/black-cat-squadron) - One button shooter based on a WW2 Navy squadron. JS13k 5th place! by [repsej](https://github.com/repsej)
165
- - [L1ttl3 Paws](https://github.com/KilledByAPixel/JS13K2025) - Cat glider with procedural art and levels for JS13K! by [KilledByAPixel](https://frankforce.com/)
166
- - [KleptoKitty](https://js13kgames.com/games/kleptokitty) - Cat themed heist puzzle. JS13K 22nd place. by [eoinmcg](https://eoinmcg.itch.io/)
167
- - [The Way of the Dodo](https://js13kgames.com/2024/games/the-way-of-the-dodo) - Single button platformer. JS13k 5th place! by [repsej](https://github.com/repsej)
168
- - [Undergrowth](https://undergrowth.squidband.uk/) - An interactive music videogame for the band Squid. by [KilledByAPixel](https://frankforce.com/)
169
- - [204Snake!](https://www.newgrounds.com/portal/view/960100) - A puzzle game that combines 2048 with snake. LittleJS Jam 1st place! by [Sodoj](https://sodoj.itch.io/) and [Shai-P](https://shai-p.itch.io/)
170
- - [GATOR](https://www.newgrounds.com/portal/view/960757) - Retro platformer shooter game where you rescue animals. LittleJS Jam 2nd place! by [eoinmcg](https://eoinmcg.itch.io/)
171
- - [A Hedgehog's Search](https://willsm1111.itch.io/a-hedgehogs-search) - Adventure game starring a hedgehog. LittleJS Jam 3rd place! by [willsm1111](https://willsm1111.itch.io/)
172
- - [Wendol Village](https://js13kgames.com/2024/games/wendol-village) - Warcraft inspired RTS game. by [sanojian](https://github.com/sanojian)
173
- - [Dead Again](https://js13kgames.com/entries/dead-again) - Top down survival horror. by [sanojian & repsej](https://github.com/sanojian/js13k_2022)
174
- - [Isletopia](https://store.steampowered.com/app/1861260/Isletopia) - Relaxing strategy game of greenifying barren islands. by [Gamex Studio](https://x.com/gamesgamex)
175
- - [Tetrimals](https://nixn.itch.io/tetrimals) - A puzzle game mixing Tetris with animals. by [nixn](https://nixn.itch.io/)
176
- - [Bug&Bee](https://itch.io/jam/littlejs-game-jam-2025/results) - Low fi shoot em up with co-op gameplay. LittleJS Jam 1st place! by [eoinmcg](https://eoinmcg.itch.io/)
177
- - [Little Platformer](https://psemo.itch.io/little-platformer) - Platformer with many mechanics. LittleJS Jam 2st place! by [PSEMO](https://psemo.itch.io/), [Solita666](https://itch.io/profile/solita666), [GabrielRG](https://gabrielrg.itch.io/), [Nate](https://natesassoon.itch.io/)
178
- - [Alien Escape Pinball](https://focaccai.itch.io/alien-pinball) - Pinball game with physics and aliens. by [Focaccai](https://www.focaccai.com/)
179
- - [LittleJS Jam 2024 Results](https://itch.io/jam/littlejs-jam-2024/results) - All the games from the first LittleJS Game Jam.
180
- - [LittleJS Jam 2025 Results](https://itch.io/jam/littlejs-game-jam-2025/results) - All the games from the second LittleJS Game Jam.
181
-
182
- ![A collage of screenshots from games made with LittleJS](examples/games.jpg)
183
-
184
- *A sample of games built with LittleJS.*
185
-
186
- ![LittleJS pixel-art favicon](examples/favicon.png)
187
-
188
- [npm]: https://img.shields.io/npm/v/littlejsengine
189
- [npm-url]: https://www.npmjs.com/package/littlejsengine
190
- [build-size]: https://img.shields.io/bundlephobia/minzip/littlejsengine
191
- [build-size-url]: https://bundlephobia.com/result?p=littlejsengine
192
- [npm-downloads]: https://img.shields.io/npm/dw/littlejsengine
193
- [npmtrends-url]: https://www.npmtrends.com/littlejsengine
194
- [deepscan]: https://deepscan.io/api/teams/22950/projects/26229/branches/831487/badge/grade.svg
195
- [deepscan-url]: https://deepscan.io/dashboard#view=project&tid=22950&pid=26229&bid=831487
196
- [discord]: https://img.shields.io/discord/939926111469568050
197
- [discord-url]: https://discord.gg/zb7hcGkyZe
198
- [license]: https://img.shields.io/github/license/KilledByAPixel/LittleJS
199
- [license-url]: https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE
1
+ # LittleJS - The Tiny Fast JavaScript Game Engine
2
+
3
+ <div align='center' markdown='1'>
4
+
5
+ ![LittleJS Logo](examples/logo.png)
6
+
7
+ [![NPM Package][npm]][npm-url]
8
+ [![Build Size][build-size]][build-size-url]
9
+ [![NPM Downloads][npm-downloads]][npmtrends-url]
10
+ [![DeepScan][deepscan]][deepscan-url]
11
+ [![MIT License][license]][license-url]
12
+ [![Discord][discord]][discord-url]
13
+
14
+ </div>
15
+
16
+ ## 🚂 All Aboard!
17
+
18
+ LittleJS is a fast, lightweight, and fully open source HTML5 game engine designed for simplicity and performance.
19
+ Its small footprint is packed with a comprehensive feature set including 2D and 3D rendering, physics, particles, sound, and input handling.
20
+ The code is very clean and well documented with many examples to get you started quickly.
21
+
22
+ ### 🚀 [Join the LittleJS Game Jam](https://itch.io/jam/littlejs-jam)
23
+
24
+ *The Third Annual LittleJS Game Jam will take place from Oct 2 to Nov 2! Unleash your creativity and develop amazing games using the LittleJS game engine.*
25
+
26
+ <div align='center' markdown='1'>
27
+
28
+ ## [Demos](https://killedbyapixel.github.io/LittleJS/examples) | [Arcade](https://killedbyapixel.github.io/LittleJSArcade) | [Docs](https://killedbyapixel.github.io/LittleJS/docs) | [FAQ](https://github.com/KilledByAPixel/LittleJS/blob/main/FAQ.md) | [Trailer](https://youtu.be/chuBzGjv7Ms) | [Discord](https://discord.gg/zb7hcGkyZe) | [AI](https://github.com/KilledByAPixel/LittleJS-AI)
29
+
30
+ </div>
31
+
32
+ ![LittleJS Screenshot1](examples/screenshot.jpg)
33
+
34
+ ![LittleJS Screenshot2](examples/screenshot2.jpg)
35
+
36
+ ## LittleJS Features
37
+
38
+ ### ✨ Graphics
39
+
40
+ - Blazing fast WebGL2 + Canvas2D hybrid rendering system
41
+ - Apply [Shadertoy](https://www.shadertoy.com) style shaders for post-processing effects, or on any object or draw
42
+ - 2D lights with soft shadows, tinted glass and emissive objects
43
+ - Robust particle effect system and [effect design tool](https://killedbyapixel.github.io/LittleJS/examples/particles/)
44
+ - Load sprites and animations into texture sheets at runtime, or import [TexturePacker](https://www.codeandweb.com/texturepacker) and [Aseprite](https://www.aseprite.org) atlases
45
+
46
+ ### 🧊 LittleJS 3D
47
+
48
+ - Built-in 3D renderer that shares the canvas with your 2D game
49
+ - 3D objects with the same physics, children and timers as 2D
50
+ - Shape builders, extruded sprites and text, and OBJ and glTF model loading
51
+ - Height map terrain with collision and raycasts
52
+ - Shadow maps, colored lights, specular, emissive glow and fog
53
+ - Particles, trails, billboards and instanced drawing
54
+ - Orbit, chase and first person cameras with mouse picking
55
+ - Custom shaders on any object
56
+ - Optional [Three.js](https://threejs.org) plugin as an alternative renderer
57
+
58
+ ### 🔊 Audio
59
+
60
+ - Sound and music with mp3, ogg, or wave files
61
+ - Use [ZzFX](https://killedbyapixel.github.io/ZzFX/) sound generator to play sounds without asset files
62
+ - Spatial audio with stereo panning
63
+ - Audio effects plugin with filter, reverb, delay, distortion and compressor
64
+
65
+ ### 🎮 Input
66
+
67
+ - Comprehensive input handling for mouse, keyboard, gamepad, and touch
68
+ - Customizable on screen gamepad designed for mobile devices
69
+
70
+ ### 💥 Physics
71
+
72
+ - Robust arcade physics system with collision handling
73
+ - Fast tilemap collision and raycasting
74
+ - Full Box2D integration for realistic physics using [Box2D v2.3.1 wasm](https://github.com/kripken/box2d.js)
75
+ - Grid-based A* pathfinding plugin with optional path smoothing
76
+
77
+ ### 🚀 Flexibility
78
+
79
+ - Compatible with all modern web browsers and mobile devices
80
+ - Full TypeScript and Module support with example projects for both
81
+ - [Vite](https://vite.dev) starter template for instant dev server with hot reload
82
+ - Great for size coding competitions like [Js13kGames](https://js13kgames.com/)
83
+ - Open Source and [MIT licensed](https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE)
84
+
85
+ ### 🛠️ Developer Tools
86
+
87
+ - Live example browser with code editor
88
+ - Import level editor data from [Tiled](https://github.com/mapeditor/tiled) or other JSON
89
+ - UI system with buttons, sliders, text input and nine-slice skins
90
+ - Tween system with easing curves
91
+ - Debug overlay and primitive rendering system
92
+ - Medal tracking system with [Newgrounds](https://www.newgrounds.com/) support
93
+ - Node.js build system
94
+
95
+ ### 🤖 AI Friendly
96
+
97
+ - The entire API is small and well documented so LLMs can produce high quality results
98
+ - [LittleJS AI Tools](https://github.com/KilledByAPixel/LittleJS-AI) - Templates, examples, and prompts tuned for AI + LittleJS workflows
99
+ - [LittleJS GPT](https://chatgpt.com/g/g-67c7c080b5bc81919736bc8815836be6-littlejs-game-maker) - Build LittleJS games right inside ChatGPT
100
+
101
+ ## How To Use LittleJS
102
+
103
+ To get started download the latest LittleJS package from GitHub or install via npm:
104
+
105
+ ```
106
+ npm install littlejsengine
107
+ ```
108
+
109
+ or use `degit` for an empty Vite template
110
+
111
+ ```
112
+ npx degit KilledByAPixel/LittleJS/examples/vite-starter my-game
113
+ cd my-game
114
+ npm install
115
+ npm run dev
116
+ ```
117
+
118
+ Here is a minimal Hello World example game, with the script path pointing at the engine file from the download or npm package.
119
+
120
+ ```html
121
+ <!DOCTYPE html>
122
+ <script src="node_modules/littlejsengine/dist/littlejs.js"></script>
123
+ <script>
124
+ function gameInit() {}
125
+ function gameUpdate() {}
126
+ function gameUpdatePost() {}
127
+ function gameRender() {}
128
+ function gameRenderPost() { drawTextScreen('Hello World!', mainCanvasSize.scale(.5), 80); }
129
+ engineInit(gameInit, gameUpdate, gameUpdatePost, gameRender, gameRenderPost);
130
+ </script>
131
+ ```
132
+
133
+ ## Tutorials
134
+
135
+ - [Making Awesome Games With LittleJS](https://youtu.be/_dXKU0WgAj8) - A short talk about LittleJS with some tips on how to use it
136
+ - [Tutorial: Breakout](https://github.com/KilledByAPixel/LittleJS/tree/main/examples/breakoutTutorial) - Learn how to make a simple game from scratch
137
+ - [Tutorial: Make a ski game](https://eoinmcgrath.com/little-ski/tutorial.html) - A tutorial by eoinmcg that shows how to make a pixel art style game
138
+ - [LittleJS Quick Reference Sheet](https://github.com/KilledByAPixel/LittleJS/blob/main/REFERENCE.md) - A reference sheet to help you get started
139
+ - [LittleJS FAQ](https://github.com/KilledByAPixel/LittleJS/blob/main/FAQ.md) - Answers to common questions about LittleJS
140
+ - [JS13k Branch](https://github.com/KilledByAPixel/LittleJS/tree/js13k) - A special branch for size coding events that builds to a 7KB zip
141
+
142
+ ## Examples
143
+
144
+ LittleJS comes with several demos both for learning and using as starter projects to create new games.
145
+
146
+ - [Example Browser](https://killedbyapixel.github.io/LittleJS/examples/) - Live example browser with all examples and editable source
147
+ - [LittleJS Arcade](https://killedbyapixel.github.io/LittleJSArcade/) - Over 50 example games you can use as starter projects
148
+ - [Short Examples](https://github.com/KilledByAPixel/LittleJS/tree/main/examples/shorts) - 80+ single-file demos showing off individual engine features
149
+ - [Breakout](https://killedbyapixel.github.io/LittleJS/examples/breakout/) - Block breaking game with post-processing effects
150
+ - [Puzzle Game](https://killedbyapixel.github.io/LittleJS/examples/puzzle/) - Match 3 puzzle game with HD rendering and high score tracking
151
+ - [Platformer](https://killedbyapixel.github.io/LittleJS/examples/platformer/) - Platformer/shooter demo that loads level data
152
+ - [Box2D Demo](https://killedbyapixel.github.io/LittleJS/examples/box2d/) - Box2D plugin demonstration and testbed
153
+ - [3D Example](https://killedbyapixel.github.io/LittleJS/examples/3d/) - The 3D plugin in one scene: terrain, shadows, lights, sprites, particles and bloom
154
+ - [3D Racing Game](https://killedbyapixel.github.io/LittleJS/examples/?example=3D%20Racing%20Game) - Built-in 3D plugin: terrain, shadows and a chase camera in one short file
155
+ - [Three.js Platformer](https://killedbyapixel.github.io/LittleJS/examples/threejs/) - 3D platformer with LittleJS gameplay and Three.js rendering
156
+ - [Stress Test](https://killedbyapixel.github.io/LittleJS/examples/stress/) - Sprite rendering benchmark and music system demo
157
+ - [Particle System Designer](https://killedbyapixel.github.io/LittleJS/examples/particles/) - Particle system editor and visualizer
158
+
159
+ ## Builds
160
+
161
+ | File | Mode | Module | Use case |
162
+ |------|------|--------|----------|
163
+ | [littlejs.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.js) | Debug | No | Debug mode with asserts |
164
+ | [littlejs.release.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.release.js) | Release | No | Optimized for release |
165
+ | [littlejs.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.min.js) | Release | No | Optimized for release and minified |
166
+ | [littlejs.esm.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.esm.js) | Debug | ESM | Debug mode with asserts |
167
+ | [littlejs.esm.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/dist/littlejs.esm.min.js) | Release | ESM | Optimized for release and minified |
168
+
169
+ Every build includes the plugins. littlejs.min.js is about 100 KB gzipped: the core engine is about 36 KB of that and the 3D plugins about 40 KB. A bundler like Vite leaves out the plugins a game does not use, so a small 2D game comes to about 26 KB gzipped, and a lit 3D scene to about 47 KB.
170
+
171
+ ## Games Made With LittleJS
172
+
173
+ Here are a few of the many amazing games created with LittleJS...
174
+
175
+ - [Space Huggers](https://www.newgrounds.com/portal/view/819609) - Roguelike platformer shoot-em-up game with procedural levels. by [KilledByAPixel](https://frankforce.com/)
176
+ - [Black Cat Squadron](https://js13kgames.com/games/black-cat-squadron) - One button shooter based on a WW2 Navy squadron. JS13k 5th place! by [repsej](https://github.com/repsej)
177
+ - [L1ttl3 Paws](https://github.com/KilledByAPixel/JS13K2025) - Cat glider with procedural art and levels for JS13K! by [KilledByAPixel](https://frankforce.com/)
178
+ - [KleptoKitty](https://js13kgames.com/games/kleptokitty) - Cat themed heist puzzle. JS13K 22nd place. by [eoinmcg](https://eoinmcg.itch.io/)
179
+ - [The Way of the Dodo](https://js13kgames.com/2024/games/the-way-of-the-dodo) - Single button platformer. JS13k 5th place! by [repsej](https://github.com/repsej)
180
+ - [Undergrowth](https://undergrowth.squidband.uk/) - An interactive music videogame for the band Squid. by [KilledByAPixel](https://frankforce.com/)
181
+ - [204Snake!](https://www.newgrounds.com/portal/view/960100) - A puzzle game that combines 2048 with snake. LittleJS Jam 1st place! by [Sodoj](https://sodoj.itch.io/) and [Shai-P](https://shai-p.itch.io/)
182
+ - [GATOR](https://www.newgrounds.com/portal/view/960757) - Retro platformer shooter game where you rescue animals. LittleJS Jam 2nd place! by [eoinmcg](https://eoinmcg.itch.io/)
183
+ - [A Hedgehog's Search](https://willsm1111.itch.io/a-hedgehogs-search) - Adventure game starring a hedgehog. LittleJS Jam 3rd place! by [willsm1111](https://willsm1111.itch.io/)
184
+ - [Wendol Village](https://js13kgames.com/2024/games/wendol-village) - Warcraft inspired RTS game. by [sanojian](https://github.com/sanojian)
185
+ - [Dead Again](https://js13kgames.com/entries/dead-again) - Top down survival horror. by [sanojian & repsej](https://github.com/sanojian/js13k_2022)
186
+ - [Isletopia](https://store.steampowered.com/app/1861260/Isletopia) - Relaxing strategy game of greenifying barren islands. by [Gamex Studio](https://x.com/gamesgamex)
187
+ - [Tetrimals](https://nixn.itch.io/tetrimals) - A puzzle game mixing Tetris with animals. by [nixn](https://nixn.itch.io/)
188
+ - [Bug&Bee](https://itch.io/jam/littlejs-game-jam-2025/results) - Low fi shoot em up with co-op gameplay. LittleJS Jam 1st place! by [eoinmcg](https://eoinmcg.itch.io/)
189
+ - [Little Platformer](https://psemo.itch.io/little-platformer) - Platformer with many mechanics. LittleJS Jam 2nd place! by [PSEMO](https://psemo.itch.io/), [Solita666](https://itch.io/profile/solita666), [GabrielRG](https://gabrielrg.itch.io/), [Nate](https://natesassoon.itch.io/)
190
+ - [Alien Escape Pinball](https://focaccai.itch.io/alien-pinball) - Pinball game with physics and aliens. by [Focaccai](https://www.focaccai.com/)
191
+ - [LittleJS Jam 2024 Results](https://itch.io/jam/littlejs-jam-2024/results) - All the games from the first LittleJS Game Jam.
192
+ - [LittleJS Jam 2025 Results](https://itch.io/jam/littlejs-game-jam-2025/results) - All the games from the second LittleJS Game Jam.
193
+
194
+ ![A collage of screenshots from games made with LittleJS](examples/games.jpg)
195
+
196
+ *A sample of games built with LittleJS.*
197
+
198
+ ![LittleJS pixel-art favicon](examples/favicon.png)
199
+
200
+ [npm]: https://img.shields.io/npm/v/littlejsengine
201
+ [npm-url]: https://www.npmjs.com/package/littlejsengine
202
+ [build-size]: https://img.shields.io/bundlephobia/minzip/littlejsengine
203
+ [build-size-url]: https://bundlephobia.com/result?p=littlejsengine
204
+ [npm-downloads]: https://img.shields.io/npm/dw/littlejsengine
205
+ [npmtrends-url]: https://www.npmtrends.com/littlejsengine
206
+ [deepscan]: https://deepscan.io/api/teams/22950/projects/26229/branches/831487/badge/grade.svg
207
+ [deepscan-url]: https://deepscan.io/dashboard#view=project&tid=22950&pid=26229&bid=831487
208
+ [discord]: https://img.shields.io/discord/939926111469568050
209
+ [discord-url]: https://discord.gg/zb7hcGkyZe
210
+ [license]: https://img.shields.io/github/license/KilledByAPixel/LittleJS
211
+ [license-url]: https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE