littlejsengine 1.2.3 → 1.3.3

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 (94) hide show
  1. package/README.md +4 -3
  2. package/build.bat +6 -6
  3. package/buildSetup.bat +7 -0
  4. package/docs/Audio.html +2268 -0
  5. package/docs/Color.html +3376 -0
  6. package/docs/Debug.html +2933 -0
  7. package/docs/Draw.html +4480 -0
  8. package/docs/EngineObject.html +4734 -0
  9. package/docs/FontImage.html +1055 -0
  10. package/docs/Input.html +2806 -0
  11. package/docs/Medal.html +1007 -0
  12. package/docs/Medals.html +628 -0
  13. package/docs/Music.html +584 -0
  14. package/docs/Newgrounds.html +1399 -0
  15. package/docs/Particle.html +4825 -0
  16. package/docs/ParticleEmitter.html +8099 -0
  17. package/docs/Random.html +1774 -0
  18. package/docs/Settings.html +3140 -0
  19. package/docs/Sound.html +1249 -0
  20. package/docs/TileCollision.html +1409 -0
  21. package/docs/TileLayer.html +7310 -0
  22. package/docs/TileLayerData.html +1052 -0
  23. package/docs/Timer.html +1295 -0
  24. package/docs/Utilities.html +3278 -0
  25. package/docs/Vector2.html +4266 -0
  26. package/docs/WebGL.html +2307 -0
  27. package/docs/engine.js.html +443 -0
  28. package/docs/engineAudio.js.html +627 -0
  29. package/docs/engineDebug.js.html +554 -0
  30. package/docs/engineDraw.js.html +539 -0
  31. package/docs/engineInput.js.html +571 -0
  32. package/docs/engineMedals.js.html +460 -0
  33. package/docs/engineObject.js.html +533 -0
  34. package/docs/engineParticles.js.html +443 -0
  35. package/docs/engineSettings.js.html +381 -0
  36. package/docs/engineTileLayer.js.html +503 -0
  37. package/docs/engineUtilities.js.html +700 -0
  38. package/docs/engineWebGL.js.html +511 -0
  39. package/docs/fonts/MavenPro-Regular.ttf +0 -0
  40. package/docs/fonts/Montserrat-Regular.ttf +0 -0
  41. package/docs/fonts/Muli-Black.ttf +0 -0
  42. package/docs/fonts/OFL-hind.txt +93 -0
  43. package/docs/fonts/OFL-montserrat.txt +93 -0
  44. package/docs/global.html +1771 -0
  45. package/docs/index.css +6 -0
  46. package/docs/index.html +267 -0
  47. package/docs/scripts/fix-code-block.js +53 -0
  48. package/docs/scripts/fix-navbar.js +25 -0
  49. package/docs/scripts/linenumber.js +25 -0
  50. package/docs/scripts/misc.js +217 -0
  51. package/docs/scripts/resize.js +85 -0
  52. package/docs/scripts/search.js +83 -0
  53. package/docs/scripts/third-party/Apache-License-2.0.txt +202 -0
  54. package/docs/scripts/third-party/fuse.js +9 -0
  55. package/docs/scripts/third-party/lang-css.js +2 -0
  56. package/docs/scripts/third-party/prettify.js +28 -0
  57. package/docs/static/favicon.png +0 -0
  58. package/docs/static/index.css +4 -0
  59. package/docs/styles/clean-jsdoc-theme-base.css +393 -0
  60. package/docs/styles/clean-jsdoc-theme-dark.css +324 -0
  61. package/docs/styles/clean-jsdoc-theme-light.css +319 -0
  62. package/docs/styles/reset.css +346 -0
  63. package/docs/styles/third-party/ionicons.min.css +11 -0
  64. package/docs/styles/third-party/prettify-jsdoc.css +111 -0
  65. package/docs/styles/third-party/prettify-tomorrow.css +5 -0
  66. package/engine/engine.all.js +171 -67
  67. package/engine/engine.all.min.js +1 -1
  68. package/engine/engine.all.release.js +162 -53
  69. package/engine/engine.js +3 -3
  70. package/engine/engineAudio.js +5 -7
  71. package/engine/engineBuild.bat +3 -4
  72. package/engine/engineDebug.js +9 -14
  73. package/engine/engineDraw.js +32 -13
  74. package/engine/engineInput.js +5 -1
  75. package/engine/engineMedals.js +5 -2
  76. package/engine/engineObject.js +24 -5
  77. package/engine/engineParticles.js +2 -2
  78. package/engine/engineSettings.js +5 -0
  79. package/engine/engineTileLayer.js +11 -10
  80. package/engine/engineUtilities.js +67 -7
  81. package/engine/engineWebGL.js +3 -3
  82. package/engine/index.d.ts +57 -18
  83. package/examples/breakout/index.html +3 -3
  84. package/examples/particles/index.html +366 -0
  85. package/examples/particles/tiles.png +0 -0
  86. package/examples/platformer/gameEffects.js +6 -6
  87. package/examples/platformer/index.html +6 -6
  88. package/examples/puzzle/game.js +4 -2
  89. package/examples/puzzle/index.html +2 -2
  90. package/examples/stress/index.html +1 -1
  91. package/game.js +3 -14
  92. package/index.html +13 -13
  93. package/package.json +1 -1
  94. package/engine/engineBuildSetup.bat +0 -7
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
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
6
 
7
- ## [LittleJS Documentation](https://killedbyapixel.github.io/LittleJS/docs) - [LittleJS Trailer](https://youtu.be/chuBzGjv7Ms) - [LittleJS Trello](https://trello.com/b/E9zf1Xak/littlejs)
7
+ ## [LittleJS Documentation](https://killedbyapixel.github.io/LittleJS/docs) - [LittleJS Trailer](https://youtu.be/chuBzGjv7Ms) - [LittleJS Discord](https://discord.gg/zb7hcGkyZe)
8
8
 
9
9
  ![LittleJS Screenshot](examples/screenshot.jpg)
10
10
 
@@ -29,7 +29,8 @@ LittleJS is a super lightweight JavaScript game engine with a fast hybrid render
29
29
  - Debug tools and debug rendering system
30
30
  - [Full documentation](https://killedbyapixel.github.io/LittleJS/docs) automatically generated from the source code block tags with [JSDoc](https://github.com/jsdoc/jsdoc)
31
31
  - Build system automatically combines everything, minifies, and removes unused code
32
- - For size coding competitions like [js13kGames](https://js13kgames.com/), starter project builds to a 7KB zip with [Roadroller](https://github.com/lifthrasiir/roadroller)
32
+ - For size coding competitions like [js13kGames](https://js13kgames.com/), starter project builds to a 7KB zip file
33
+ - (https://github.com/lifthrasiir/roadroller)
33
34
  - Easily build a Windows executable with [Electron](https://www.electronjs.org/) for distribution on platforms like Steam
34
35
  - Open Source with the [MIT license](https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE) so it can be used for anything you want
35
36
 
@@ -41,7 +42,7 @@ To easily include LittleJS in your game, you can use one of the 3 pre-built js f
41
42
  - [engine.all.release.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.release.js) - The engine optimized for release builds
42
43
  - [engine.all.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.min.js) - The engine in release mode and minified
43
44
 
44
- 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.
45
+ 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.
45
46
 
46
47
  ## Games Made With LittleJS
47
48
 
package/build.bat CHANGED
@@ -1,6 +1,6 @@
1
1
  rem Simple build script for LittleJS by Frank Force
2
2
  rem Minfies and combines index.html and index.js and zips the result
3
- rem Run engine\buildSetup.bat first to install dependencies
3
+ rem Run buildSetup.bat to install required dependencies.
4
4
 
5
5
  set NAME=game
6
6
  set BUILD_FOLDER=build
@@ -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 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_2019 --warning_level=VERBOSE --jscomp_off=* --assume_function_wrapper
38
38
  if %ERRORLEVEL% NEQ 0 (
39
39
  pause
40
40
  exit /b %ERRORLEVEL%
@@ -42,16 +42,16 @@ if %ERRORLEVEL% NEQ 0 (
42
42
  del %BUILD_FILENAME%.temp
43
43
 
44
44
  rem more minification with uglify or terser (they both do about the same)
45
- call uglifyjs -o %BUILD_FILENAME% --compress --mangle -- %BUILD_FILENAME%
45
+ call npx uglifyjs -o %BUILD_FILENAME% --compress --mangle -- %BUILD_FILENAME%
46
46
  rem call terser -o %BUILD_FILENAME% --compress --mangle -- %BUILD_FILENAME%
47
47
  if %ERRORLEVEL% NEQ 0 (
48
48
  pause
49
49
  exit /b %ERRORLEVEL%
50
50
  )
51
51
 
52
- rem roadroaller compresses the code better then zip
52
+ rem roadroller compresses the code better then zip
53
53
  copy %BUILD_FILENAME% roadroller_%BUILD_FILENAME%
54
- call roadroller roadroller_%BUILD_FILENAME% -o roadroller_%BUILD_FILENAME%
54
+ call npx roadroller roadroller_%BUILD_FILENAME% -o roadroller_%BUILD_FILENAME%
55
55
  if %ERRORLEVEL% NEQ 0 (
56
56
  pause
57
57
  exit /b %ERRORLEVEL%
@@ -64,7 +64,7 @@ type roadroller_%BUILD_FILENAME% >> index.html
64
64
  echo ^</script^> >> index.html
65
65
 
66
66
  rem zip the result, ect is recommended
67
- call ect -9 -strip -zip ..\%NAME%.zip index.html tiles.png
67
+ call ..\node_modules\ect-bin\vendor\win32\ect.exe -9 -strip -zip ..\%NAME%.zip index.html tiles.png
68
68
  if %ERRORLEVEL% NEQ 0 (
69
69
  pause
70
70
  exit /b %ERRORLEVEL%
package/buildSetup.bat ADDED
@@ -0,0 +1,7 @@
1
+ rem Run this file to install the necessary npm depencies.
2
+
3
+ call npm install google-closure-compiler
4
+ call npm install uglify-js
5
+ call npm install roadroller
6
+ call npm install ect-bin
7
+ call npm install typescript