littlejsengine 1.4.7 → 1.4.8
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.
- package/README.md +6 -1
- package/build.bat +7 -3
- package/engine/engine.all.js +266 -295
- package/engine/engine.all.min.js +1 -1
- package/engine/engine.all.module.js +276 -315
- package/engine/engine.all.module.min.js +1 -0
- package/engine/engine.all.release.js +266 -295
- package/engine/engine.js +21 -30
- package/engine/engineAudio.js +8 -15
- package/engine/engineBuild.bat +10 -3
- package/engine/engineDraw.js +14 -18
- package/engine/engineExport.js +10 -20
- package/engine/engineInput.js +84 -71
- package/engine/engineMedals.js +25 -32
- package/engine/engineObject.js +2 -2
- package/engine/engineParticles.js +7 -6
- package/engine/engineSettings.js +27 -27
- package/engine/engineTileLayer.js +15 -16
- package/engine/engineUtilities.js +26 -13
- package/engine/engineWebGL.js +38 -66
- package/engine/index.d.ts +52 -39
- package/examples/breakout/index.html +3 -3
- package/examples/module/index.html +1 -1
- package/examples/particles/index.html +12 -12
- package/examples/platformer/index.html +6 -6
- package/examples/puzzle/index.html +2 -2
- package/examples/stress/index.html +1 -1
- package/favicon.png +0 -0
- package/game.js +6 -8
- package/index.html +13 -13
- package/package.json +1 -1
- package/engine/engine.all.release.module.js +0 -4464
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ LittleJS is a super lightweight JavaScript game engine with a fast hybrid render
|
|
|
27
27
|
- Positional audio effects with [ZzFX](https://killedbyapixel.github.io/ZzFX/) and music with [ZzFXM](https://keithclark.github.io/ZzFXM/), mp3s, or wavs
|
|
28
28
|
- Input processing system with keyboard, mouse, gamepad, and touch support
|
|
29
29
|
- Particle effects system (particle editor/designer in progress)
|
|
30
|
-
- Medal system tracks and displays achievements with Newgrounds
|
|
30
|
+
- Medal system tracks and displays achievements with Newgrounds integration
|
|
31
31
|
- Several easy to understand example projects you can build on
|
|
32
32
|
- Apply [Shadertoy](https://www.shadertoy.com) compatible shaders for post processinge effects
|
|
33
33
|
- Debug tools and debug rendering system
|
|
@@ -46,6 +46,11 @@ To easily include LittleJS in your game, you can use one of the 3 pre-built js f
|
|
|
46
46
|
- [engine.all.release.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.release.js) - The engine optimized for release builds
|
|
47
47
|
- [engine.all.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.min.js) - The engine in release mode and minified
|
|
48
48
|
|
|
49
|
+
LittleJS can also be imported as a module. There are two module includes that are automatically built.
|
|
50
|
+
|
|
51
|
+
- [engine.all.module.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.module.js) - The engine exported as a module with debug mode available
|
|
52
|
+
- [engine.all.module.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.module.min.js) - The engine exported as a module in release mode
|
|
53
|
+
|
|
49
54
|
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.
|
|
50
55
|
|
|
51
56
|
## Debugging
|
package/build.bat
CHANGED
|
@@ -33,13 +33,12 @@ rem copy images to build folder
|
|
|
33
33
|
copy ..\tiles.png tiles.png
|
|
34
34
|
|
|
35
35
|
rem minify code with closure
|
|
36
|
-
move %BUILD_FILENAME% %BUILD_FILENAME
|
|
37
|
-
call npx google-closure-compiler --js
|
|
36
|
+
move %BUILD_FILENAME% temp_%BUILD_FILENAME%
|
|
37
|
+
call npx google-closure-compiler --js=temp_%BUILD_FILENAME% --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%
|
|
41
41
|
)
|
|
42
|
-
del %BUILD_FILENAME%.temp
|
|
43
42
|
|
|
44
43
|
rem more minification with uglify or terser (they both do about the same)
|
|
45
44
|
call npx uglifyjs -o %BUILD_FILENAME% --compress --mangle -- %BUILD_FILENAME%
|
|
@@ -63,6 +62,11 @@ echo ^<body^>^<meta charset=utf-8^>^<script^> >> index.html
|
|
|
63
62
|
type roadroller_%BUILD_FILENAME% >> index.html
|
|
64
63
|
echo ^</script^> >> index.html
|
|
65
64
|
|
|
65
|
+
rem delete intermediate files
|
|
66
|
+
del %BUILD_FILENAME%
|
|
67
|
+
del temp_%BUILD_FILENAME%
|
|
68
|
+
del roadroller_%BUILD_FILENAME%
|
|
69
|
+
|
|
66
70
|
rem zip the result, ect is recommended
|
|
67
71
|
call ..\node_modules\ect-bin\vendor\win32\ect.exe -9 -strip -zip ..\%NAME%.zip index.html tiles.png
|
|
68
72
|
if %ERRORLEVEL% NEQ 0 (
|