littlejsengine 1.2.0 → 1.3.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.
- package/README.md +5 -9
- package/build.bat +5 -5
- package/buildSetup.bat +7 -0
- package/engine/engine.all.js +193 -125
- package/engine/engine.all.min.js +1 -1
- package/engine/engine.all.release.js +183 -110
- package/engine/engine.js +10 -33
- package/engine/engineBuild.bat +3 -3
- package/engine/engineDebug.js +10 -15
- package/engine/engineDraw.js +38 -17
- package/engine/engineFont.png +0 -0
- package/engine/engineInput.js +22 -6
- package/engine/engineMedals.js +7 -4
- package/engine/engineObject.js +17 -1
- package/engine/engineParticles.js +5 -3
- package/engine/engineSettings.js +5 -0
- package/engine/engineTileLayer.js +11 -10
- package/engine/engineUtilities.js +38 -6
- package/engine/engineWebGL.js +30 -30
- package/engine/index.d.ts +55 -21
- package/examples/breakout/gameObjects.js +2 -2
- package/examples/breakout/index.html +3 -3
- package/examples/particles/index.html +366 -0
- package/examples/particles/tiles.png +0 -0
- package/examples/platformer/game.js +4 -4
- package/examples/platformer/gameEffects.js +9 -9
- package/examples/platformer/gameObjects.js +2 -2
- package/examples/platformer/index.html +6 -6
- package/examples/puzzle/game.js +2 -2
- package/examples/puzzle/index.html +2 -2
- package/examples/screenshot.jpg +0 -0
- package/examples/stress/index.html +2 -2
- package/game.js +4 -4
- package/index.html +13 -13
- package/package.json +1 -1
- package/engine/engineBuildSetup.bat +0 -7
package/README.md
CHANGED
|
@@ -19,23 +19,19 @@ LittleJS is a super lightweight JavaScript game engine with a fast hybrid render
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
21
21
|
- Very small footprint with no dependencies
|
|
22
|
-
- Can render 10,000+ objects at 60fps, often many times more
|
|
23
|
-
- Object oriented system with
|
|
24
|
-
- Fast 2D physics and collision handling for axis aligned boxes
|
|
22
|
+
- Can update and render 10,000+ objects at 60fps, often many times more
|
|
23
|
+
- Object oriented system with fast 2D physics and collision handling for axis aligned boxes
|
|
25
24
|
- Positional audio effects with [zzfx](https://killedbyapixel.github.io/ZzFX/) and music with [zzfxm](https://keithclark.github.io/ZzFXM/), mp3s, or wavs
|
|
26
25
|
- Input processing system with keyboard, mouse, gamepad, and touch support
|
|
27
|
-
- Engine helper functions and classes like Vector2, Color, and Timer
|
|
28
|
-
- Tile layer cached rendering and collision system for level data
|
|
29
26
|
- Particle effects system (particle editor/designer in progress)
|
|
30
27
|
- Medal system tracks and displays achievements with Newgrounds and OS13k integration
|
|
31
28
|
- Several easy to understand example projects you can build on
|
|
32
|
-
- All example projects are compatible with mobile devices
|
|
33
29
|
- Debug tools and debug rendering system
|
|
34
30
|
- [Full documentation](https://killedbyapixel.github.io/LittleJS/docs) automatically generated from the source code block tags with [JSDoc](https://github.com/jsdoc/jsdoc)
|
|
35
31
|
- Build system automatically combines everything, minifies, and removes unused code
|
|
36
32
|
- For size coding competitions like [js13kGames](https://js13kgames.com/), starter project builds to a 7KB zip with [Roadroller](https://github.com/lifthrasiir/roadroller)
|
|
37
|
-
- Easily build a Windows executable with [
|
|
38
|
-
- Open Source with the [MIT license](https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE) so it can be used
|
|
33
|
+
- Easily build a Windows executable with [Electron](https://www.electronjs.org/) for distribution on platforms like Steam
|
|
34
|
+
- Open Source with the [MIT license](https://github.com/KilledByAPixel/LittleJS/blob/main/LICENSE) so it can be used for anything you want
|
|
39
35
|
|
|
40
36
|
## Builds
|
|
41
37
|
|
|
@@ -45,7 +41,7 @@ To easily include LittleJS in your game, you can use one of the 3 pre-built js f
|
|
|
45
41
|
- [engine.all.release.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.release.js) - The engine optimized for release builds
|
|
46
42
|
- [engine.all.min.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.min.js) - The engine in release mode and minified
|
|
47
43
|
|
|
48
|
-
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.
|
|
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. You must run buildSetup.bat to install the necessary npm dependencies.
|
|
49
45
|
|
|
50
46
|
## Games Made With LittleJS
|
|
51
47
|
|
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
|
|
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
|
|
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,7 +42,7 @@ 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
|
|
@@ -51,7 +51,7 @@ if %ERRORLEVEL% NEQ 0 (
|
|
|
51
51
|
|
|
52
52
|
rem roadroaller 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%
|