littlejsengine 1.3.8 → 1.4.5

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 (42) hide show
  1. package/README.md +30 -9
  2. package/build.bat +1 -1
  3. package/buildSetup.bat +2 -2
  4. package/engine/engine.all.js +276 -167
  5. package/engine/engine.all.min.js +1 -1
  6. package/engine/engine.all.module.js +4812 -0
  7. package/engine/engine.all.release.js +259 -143
  8. package/engine/engine.all.release.module.js +4457 -0
  9. package/engine/engine.js +12 -8
  10. package/engine/engineBuild.bat +1 -1
  11. package/engine/engineBuildModule.mjs +14 -0
  12. package/engine/engineDebug.js +17 -24
  13. package/engine/engineDraw.js +16 -16
  14. package/engine/engineExportModule.js +333 -0
  15. package/engine/engineInput.js +9 -8
  16. package/engine/engineMedals.js +10 -6
  17. package/engine/engineObject.js +4 -4
  18. package/engine/engineParticles.js +45 -21
  19. package/engine/engineTileLayer.js +2 -2
  20. package/engine/engineUtilities.js +47 -25
  21. package/engine/engineWebGL.js +114 -54
  22. package/engine/index.d.ts +64 -30
  23. package/examples/breakout/game.js +63 -11
  24. package/examples/breakout/gameObjects.js +14 -12
  25. package/examples/breakout/index.html +3 -3
  26. package/examples/empty/game.js +35 -0
  27. package/examples/empty/index.html +9 -0
  28. package/examples/empty/tiles.png +0 -0
  29. package/examples/module/game.js +122 -0
  30. package/examples/module/index.html +9 -0
  31. package/examples/module/tiles.png +0 -0
  32. package/examples/particles/index.html +14 -14
  33. package/examples/particles/tiles.png +0 -0
  34. package/examples/platformer/game.js +1 -1
  35. package/examples/platformer/gameObjects.js +7 -7
  36. package/examples/platformer/gamePlayer.js +7 -5
  37. package/examples/platformer/index.html +6 -6
  38. package/examples/puzzle/index.html +2 -2
  39. package/examples/stress/index.html +2 -2
  40. package/game.js +10 -12
  41. package/index.html +13 -13
  42. package/package.json +36 -32
package/README.md CHANGED
@@ -2,41 +2,45 @@
2
2
 
3
3
  ## All aboard!
4
4
 
5
- LittleJS is a super lightweight JavaScript game engine with a fast hybrid rendering system. It provides everything necessary to make amazing games, including rendering, physics, particles, sound effects, music, input handling, and debug tools. LittleJS is designed to be extremely small yet powerful enough for a variety of applications, from game jams to commercial releases. The code is very well documented with a variety of examples to get you started. Choo-Choo! 🚂
6
-
7
- ## [LittleJS Documentation](https://killedbyapixel.github.io/LittleJS/docs) - [LittleJS Trailer](https://youtu.be/chuBzGjv7Ms) - [LittleJS Discord](https://discord.gg/zb7hcGkyZe)
5
+ 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! 🚂
6
+ <div align="center">
7
+
8
+ ## [Demo](https://killedbyapixel.github.io/LittleJS) | [Docs](https://killedbyapixel.github.io/LittleJS/docs) | [Trailer](https://youtu.be/chuBzGjv7Ms) | [Discord](https://discord.gg/zb7hcGkyZe)
9
+ </div>
8
10
 
9
11
  ![LittleJS Screenshot](examples/screenshot.jpg)
10
12
 
11
- ## Example Projects
13
+ ## Examples
12
14
 
13
15
  ### [Hello World](https://killedbyapixel.github.io/LittleJS/) - Clean project with only a few things to get you started
14
16
  ### [Puzzle Game](https://killedbyapixel.github.io/LittleJS/examples/puzzle) - Match 3 puzzle game with HD rendering and high score tracking
15
17
  ### [Platformer](https://killedbyapixel.github.io/LittleJS/examples/platformer) - Platformer/shooter with procedural generation and destruction
16
- ### [Breakout](https://killedbyapixel.github.io/LittleJS/examples/breakout) - Breakout game with mouse/touch or gamepad control
18
+ ### [Breakout](https://killedbyapixel.github.io/LittleJS/examples/breakout) - Breakout game with post processing effect
17
19
  ### [Stress Test](https://killedbyapixel.github.io/LittleJS/examples/stress) - Max sprite/object test and music system demo
20
+ ### [Particle System Designer](https://killedbyapixel.github.io/LittleJS/examples/particles) - Particle system editor and visualizer
18
21
 
19
22
  ## Features
20
23
 
21
24
  - Very small footprint with no dependencies
22
25
  - Can update and render 10,000+ objects at 60fps, often many times more
23
26
  - Object oriented system with fast 2D physics and collision handling for axis aligned boxes
24
- - Positional audio effects with [zzfx](https://killedbyapixel.github.io/ZzFX/) and music with [zzfxm](https://keithclark.github.io/ZzFXM/), mp3s, or wavs
27
+ - Positional audio effects with [ZzFX](https://killedbyapixel.github.io/ZzFX/) and music with [ZzFXM](https://keithclark.github.io/ZzFXM/), mp3s, or wavs
25
28
  - Input processing system with keyboard, mouse, gamepad, and touch support
26
29
  - Particle effects system (particle editor/designer in progress)
27
30
  - Medal system tracks and displays achievements with Newgrounds and OS13k integration
28
31
  - Several easy to understand example projects you can build on
32
+ - Apply [Shadertoy](https://www.shadertoy.com) compatible shaders for post processinge effects
29
33
  - Debug tools and debug rendering system
30
34
  - [Full documentation](https://killedbyapixel.github.io/LittleJS/docs) automatically generated from the source code block tags with [JSDoc](https://github.com/jsdoc/jsdoc)
31
35
  - Build system automatically combines everything, minifies, and removes unused code
32
36
  - For size coding competitions like [js13kGames](https://js13kgames.com/), starter project builds to a 7KB zip file
33
- - (https://github.com/lifthrasiir/roadroller)
34
37
  - Easily build a Windows executable with [Electron](https://www.electronjs.org/) for distribution on platforms like Steam
35
38
  - Open Source with the [MIT license](https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE) so it can be used for anything you want
39
+ - Can be imported as a JavaScript module and includes [an example module project](https://killedbyapixel.github.io/LittleJS/examples/module)
36
40
 
37
41
  ## Builds
38
42
 
39
- 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..
43
+ 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.
40
44
 
41
45
  - [engine.all.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.js) - The full game engine with debug mode available
42
46
  - [engine.all.release.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.release.js) - The engine optimized for release builds
@@ -44,11 +48,28 @@ To easily include LittleJS in your game, you can use one of the 3 pre-built js f
44
48
 
45
49
  The hello world example includes a batch file [build.bat](https://github.com/KilledByAPixel/LittleJS/blob/main/build.bat) that compresses everything into a tiny zip file using Google Closure, UglifyJS, Roadroller, and ECT. You must run [buildSetup.bat](https://github.com/KilledByAPixel/LittleJS/blob/main/buildSetup.bat) to install the necessary npm dependencies.
46
50
 
51
+ ## Debugging
52
+
53
+ Debug builds of LittleJS have a special menu that can be opened by pressing ~, the tilde key.
54
+
55
+ - ~: Debug Overlay
56
+ - 1: Debug Physics
57
+ - 2: Debug Particles
58
+ - 3: Debug Gamepads
59
+ - 4: God Mode
60
+ - 5: Save Screenshot
61
+
47
62
  ## Games Made With LittleJS
48
63
 
49
64
  - [Space Huggers](https://www.newgrounds.com/portal/view/819609) - Run and gun platformer with procedural levels
50
- - [Space Huggers - JS13k Edition](https://github.com/KilledByAPixel/SpaceHuggers) - Original js13k game with source code
65
+ - [Undergrowth](https://undergrowth.squidband.uk/) - An interactive music videogame for the band Squid
66
+ - [Space Huggers - JS13K Edition](https://github.com/KilledByAPixel/SpaceHuggers) - Original js13k game with source code
51
67
  - [Isletopia](https://store.steampowered.com/app/1861260/Isletopia) - Relaxing strategy game of greenifying barren islands
68
+ - [Dead Again](https://js13kgames.com/entries/dead-again) - Top down survial horror by [sanojian & repsej](https://github.com/sanojian/js13k_2022)
69
+ - [Hel's Trial](https://js13kgames.com/entries/hels-trial) - Turn based RPG by [Sebastian Dorn](https://github.com/sebadorn/js13k-2022-death)
70
+ - [Bit Butcher](https://js13kgames.com/entries/bit-butcher) - Survival crafting game by [Deathray Games](https://github.com/deathraygames/bit-butcher)
71
+ - [Necrotic Commander](https://js13kgames.com/entries/necrotic-commander) - Tower defense game by [Daniel Jeffery](https://github.com/d-jeffery/NecroticCommander)
72
+ - [Boxing up Bamboo](https://patrickgh3.itch.io/boxing-up-bamboo) - A challenging puzzle game by [Patrick Traynor](https://cwpat.me/about)
52
73
  - Send me your games!
53
74
 
54
75
  ![LittleJS Logo](favicon.png)
package/build.bat CHANGED
@@ -34,7 +34,7 @@ copy ..\tiles.png tiles.png
34
34
 
35
35
  rem minify code with closure
36
36
  move %BUILD_FILENAME% %BUILD_FILENAME%.temp
37
- call npx google-closure-compiler --js=%BUILD_FILENAME%.temp --js_output_file=%BUILD_FILENAME% --compilation_level=ADVANCED --language_out=ECMASCRIPT_2019 --warning_level=VERBOSE --jscomp_off=* --assume_function_wrapper
37
+ call npx google-closure-compiler --js=%BUILD_FILENAME%.temp --js_output_file=%BUILD_FILENAME% --compilation_level=ADVANCED --language_out=ECMASCRIPT_2021 --warning_level=VERBOSE --jscomp_off=* --assume_function_wrapper
38
38
  if %ERRORLEVEL% NEQ 0 (
39
39
  pause
40
40
  exit /b %ERRORLEVEL%
package/buildSetup.bat CHANGED
@@ -1,4 +1,4 @@
1
- rem Run this file to install the necessary npm depencies.
1
+ rem Run this file to install the necessary npm dependencies.
2
2
 
3
3
  call npm install google-closure-compiler
4
4
  call npm install uglify-js
@@ -6,5 +6,5 @@ call npm install roadroller
6
6
  call npm install ect-bin
7
7
  call npm install typescript
8
8
 
9
- echo Finishd installing LittleJS build dependencies.
9
+ echo Finished installing LittleJS build dependencies.
10
10
  pause