littlejsengine 1.5.2 → 1.6.4
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 +155 -33
- package/{engine/index.d.ts → build/littlejs.d.ts} +14 -6
- package/{engine/engine.all.module.js → build/littlejs.esm.js} +110 -99
- package/build/littlejs.esm.min.js +1 -0
- package/{engine/engine.all.js → build/littlejs.js} +102 -97
- package/build/littlejs.min.js +1 -0
- package/{engine/engine.all.release.js → build/littlejs.release.js} +95 -95
- package/examples/breakout/game.js +5 -0
- package/examples/breakout/gameObjects.js +41 -48
- package/examples/breakout/index.html +5 -4
- package/examples/breakoutTutorial/README.md +514 -0
- package/examples/breakoutTutorial/game.js +181 -0
- package/examples/breakoutTutorial/images/1.png +0 -0
- package/examples/breakoutTutorial/images/10.png +0 -0
- package/examples/breakoutTutorial/images/11.png +0 -0
- package/examples/breakoutTutorial/images/2.png +0 -0
- package/examples/breakoutTutorial/images/3.png +0 -0
- package/examples/breakoutTutorial/images/4.png +0 -0
- package/examples/breakoutTutorial/images/5.png +0 -0
- package/examples/breakoutTutorial/images/6.png +0 -0
- package/examples/breakoutTutorial/images/7.png +0 -0
- package/examples/breakoutTutorial/images/8.png +0 -0
- package/examples/breakoutTutorial/images/9.png +0 -0
- package/examples/breakoutTutorial/index.html +10 -0
- package/examples/electron/build.bat +52 -0
- package/{electron → examples/electron}/electron.js +18 -21
- package/{game.js → examples/electron/game.js} +1 -1
- package/examples/electron/index.html +2 -0
- package/examples/electron/package.json +20 -0
- package/examples/empty/game.js +11 -1
- package/examples/empty/index.html +2 -2
- package/examples/module/game.js +1 -1
- package/examples/module/index.html +3 -2
- package/examples/particles/index.html +3 -2
- package/examples/platformer/gameLevel.js +1 -1
- package/examples/platformer/gamePlayer.js +1 -1
- package/examples/platformer/index.html +8 -7
- package/examples/puzzle/index.html +4 -3
- package/{build.bat → examples/starter/build.bat} +17 -17
- package/examples/starter/game.js +111 -0
- package/examples/starter/index.html +27 -0
- package/examples/starter/tiles.png +0 -0
- package/examples/stress/index.html +3 -2
- package/examples/typescript/game.js +89 -89
- package/examples/typescript/game.ts +11 -11
- package/examples/typescript/index.html +3 -2
- package/package.json +4 -4
- package/{engine → src}/engine.js +1 -2
- package/{engine → src}/engineAudio.js +11 -11
- package/src/engineBuild.bat +132 -0
- package/{engine → src}/engineDebug.js +8 -2
- package/{engine → src}/engineDraw.js +19 -15
- package/{engine → src}/engineExport.js +8 -2
- package/{engine → src}/engineInput.js +54 -58
- package/{engine → src}/engineMedals.js +1 -1
- package/{engine → src}/engineObject.js +4 -4
- package/{engine → src}/engineRelease.js +1 -0
- package/{engine → src}/engineUtilities.js +4 -4
- package/electron/electronBuild.bat +0 -32
- package/electron/electronSetup.bat +0 -2
- package/electron/package.json +0 -21
- package/engine/engine.all.min.js +0 -1
- package/engine/engine.all.module.min.js +0 -1
- package/engine/engineBuild.bat +0 -127
- package/index.html +0 -26
- /package/{tiles.png → examples/electron/tiles.png} +0 -0
- /package/{favicon.png → examples/favicon.png} +0 -0
- /package/{engine → src}/engineFont.png +0 -0
- /package/{engine → src}/engineParticles.js +0 -0
- /package/{engine → src}/engineSettings.js +0 -0
- /package/{engine → src}/engineTileLayer.js +0 -0
- /package/{engine → src}/engineWebGL.js +0 -0
package/engine/engineBuild.bat
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
rem Simple build script for LittleJS Engine by Frank Force
|
|
2
|
-
rem minfies and combines index.html and index.js and zips the result
|
|
3
|
-
|
|
4
|
-
rem --- BUILD ENGINE DEBUG ---
|
|
5
|
-
|
|
6
|
-
set OUTPUT_FILENAME=engine.all.js
|
|
7
|
-
|
|
8
|
-
rem remove old files
|
|
9
|
-
del %OUTPUT_FILENAME%
|
|
10
|
-
|
|
11
|
-
rem combine code
|
|
12
|
-
type engineDebug.js >> %OUTPUT_FILENAME%
|
|
13
|
-
echo.>> %OUTPUT_FILENAME%
|
|
14
|
-
type engineUtilities.js >> %OUTPUT_FILENAME%
|
|
15
|
-
echo.>> %OUTPUT_FILENAME%
|
|
16
|
-
type engineSettings.js >> %OUTPUT_FILENAME%
|
|
17
|
-
echo.>> %OUTPUT_FILENAME%
|
|
18
|
-
type engineObject.js >> %OUTPUT_FILENAME%
|
|
19
|
-
echo.>> %OUTPUT_FILENAME%
|
|
20
|
-
type engineDraw.js >> %OUTPUT_FILENAME%
|
|
21
|
-
echo.>> %OUTPUT_FILENAME%
|
|
22
|
-
type engineInput.js >> %OUTPUT_FILENAME%
|
|
23
|
-
echo.>> %OUTPUT_FILENAME%
|
|
24
|
-
type engineAudio.js >> %OUTPUT_FILENAME%
|
|
25
|
-
echo.>> %OUTPUT_FILENAME%
|
|
26
|
-
type engineTileLayer.js >> %OUTPUT_FILENAME%
|
|
27
|
-
echo.>> %OUTPUT_FILENAME%
|
|
28
|
-
type engineParticles.js >> %OUTPUT_FILENAME%
|
|
29
|
-
echo.>> %OUTPUT_FILENAME%
|
|
30
|
-
type engineMedals.js >> %OUTPUT_FILENAME%
|
|
31
|
-
echo.>> %OUTPUT_FILENAME%
|
|
32
|
-
type engineWebGL.js >> %OUTPUT_FILENAME%
|
|
33
|
-
echo.>> %OUTPUT_FILENAME%
|
|
34
|
-
type engine.js >> %OUTPUT_FILENAME%
|
|
35
|
-
echo.>> %OUTPUT_FILENAME%
|
|
36
|
-
|
|
37
|
-
rem --- BUILD ENGINE RELEASE ---
|
|
38
|
-
|
|
39
|
-
set OUTPUT_FILENAME=engine.all.release.js
|
|
40
|
-
|
|
41
|
-
rem remove old files
|
|
42
|
-
del %OUTPUT_FILENAME%
|
|
43
|
-
|
|
44
|
-
rem combine code
|
|
45
|
-
type engineRelease.js >> %OUTPUT_FILENAME%
|
|
46
|
-
echo.>> %OUTPUT_FILENAME%
|
|
47
|
-
type engineUtilities.js >> %OUTPUT_FILENAME%
|
|
48
|
-
echo.>> %OUTPUT_FILENAME%
|
|
49
|
-
type engineSettings.js >> %OUTPUT_FILENAME%
|
|
50
|
-
echo.>> %OUTPUT_FILENAME%
|
|
51
|
-
type engine.js >> %OUTPUT_FILENAME%
|
|
52
|
-
echo.>> %OUTPUT_FILENAME%
|
|
53
|
-
type engineObject.js >> %OUTPUT_FILENAME%
|
|
54
|
-
echo.>> %OUTPUT_FILENAME%
|
|
55
|
-
type engineDraw.js >> %OUTPUT_FILENAME%
|
|
56
|
-
echo.>> %OUTPUT_FILENAME%
|
|
57
|
-
type engineInput.js >> %OUTPUT_FILENAME%
|
|
58
|
-
echo.>> %OUTPUT_FILENAME%
|
|
59
|
-
type engineAudio.js >> %OUTPUT_FILENAME%
|
|
60
|
-
echo.>> %OUTPUT_FILENAME%
|
|
61
|
-
type engineTileLayer.js >> %OUTPUT_FILENAME%
|
|
62
|
-
echo.>> %OUTPUT_FILENAME%
|
|
63
|
-
type engineParticles.js >> %OUTPUT_FILENAME%
|
|
64
|
-
echo.>> %OUTPUT_FILENAME%
|
|
65
|
-
type engineMedals.js >> %OUTPUT_FILENAME%
|
|
66
|
-
echo.>> %OUTPUT_FILENAME%
|
|
67
|
-
type engineWebGL.js >> %OUTPUT_FILENAME%
|
|
68
|
-
echo.>> %OUTPUT_FILENAME%
|
|
69
|
-
|
|
70
|
-
rem --- BUILD ENGINE MINIFIED ---
|
|
71
|
-
|
|
72
|
-
set OUTPUT_FILENAME=engine.all.min.js
|
|
73
|
-
|
|
74
|
-
rem remove old files
|
|
75
|
-
del %OUTPUT_FILENAME%
|
|
76
|
-
|
|
77
|
-
rem start with release build
|
|
78
|
-
copy engine.all.release.js %OUTPUT_FILENAME%
|
|
79
|
-
|
|
80
|
-
rem check code with closure
|
|
81
|
-
move %OUTPUT_FILENAME% %OUTPUT_FILENAME%.temp
|
|
82
|
-
call npx google-closure-compiler --js=%OUTPUT_FILENAME%.temp --js_output_file=%OUTPUT_FILENAME% --language_out=ECMASCRIPT_2021 --warning_level=VERBOSE --jscomp_off=*
|
|
83
|
-
del %OUTPUT_FILENAME%.temp
|
|
84
|
-
if %ERRORLEVEL% NEQ 0 (
|
|
85
|
-
pause
|
|
86
|
-
exit /b %ERRORLEVEL%
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
rem lightly minify with uglify
|
|
90
|
-
call npx uglifyjs -o %OUTPUT_FILENAME% -- %OUTPUT_FILENAME%
|
|
91
|
-
if %ERRORLEVEL% NEQ 0 (
|
|
92
|
-
pause
|
|
93
|
-
exit /b %ERRORLEVEL%
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
rem --- BUILD ENGINE MODULE ---
|
|
97
|
-
|
|
98
|
-
set OUTPUT_FILENAME=engine.all.module.js
|
|
99
|
-
del %OUTPUT_FILENAME%
|
|
100
|
-
type engine.all.js >> %OUTPUT_FILENAME%
|
|
101
|
-
echo.>> %OUTPUT_FILENAME%
|
|
102
|
-
type engineExport.js >> %OUTPUT_FILENAME%
|
|
103
|
-
echo.>> %OUTPUT_FILENAME%
|
|
104
|
-
|
|
105
|
-
rem --- BUILD ENGINE MODULE RELEASE ---
|
|
106
|
-
|
|
107
|
-
set OUTPUT_FILENAME=engine.all.module.min.js
|
|
108
|
-
del %OUTPUT_FILENAME%
|
|
109
|
-
type engine.all.min.js >> %OUTPUT_FILENAME%
|
|
110
|
-
echo.>> %OUTPUT_FILENAME%
|
|
111
|
-
type engineExport.js >> %OUTPUT_FILENAME%
|
|
112
|
-
echo.>> %OUTPUT_FILENAME%
|
|
113
|
-
|
|
114
|
-
rem lightly minify with uglify
|
|
115
|
-
call npx uglifyjs -o %OUTPUT_FILENAME% -- %OUTPUT_FILENAME%
|
|
116
|
-
if %ERRORLEVEL% NEQ 0 (
|
|
117
|
-
pause
|
|
118
|
-
exit /b %ERRORLEVEL%
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
rem --- BUILD TYPESCRIPT DEFINITIONS ---
|
|
122
|
-
|
|
123
|
-
call npx tsc engine.all.module.js --declaration --allowJs --emitDeclarationOnly --outFile index.d.ts
|
|
124
|
-
if %ERRORLEVEL% NEQ 0 (
|
|
125
|
-
pause
|
|
126
|
-
exit /b %ERRORLEVEL%
|
|
127
|
-
)
|
package/index.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<html><head>
|
|
2
|
-
<meta name=viewport content=width=device-width,height=device-height,initial-scale=1,maximum-scale=1>
|
|
3
|
-
<meta name=apple-mobile-web-app-capable content=yes>
|
|
4
|
-
<meta name=mobile-web-app-capable content=yes>
|
|
5
|
-
<link rel=icon type=image/png href=favicon.png>
|
|
6
|
-
</head><body>
|
|
7
|
-
|
|
8
|
-
<!-- LittleJS engine scripts -->
|
|
9
|
-
<script src=engine/engineDebug.js?125></script>
|
|
10
|
-
<script src=engine/engineUtilities.js?125></script>
|
|
11
|
-
<script src=engine/engineSettings.js?125></script>
|
|
12
|
-
<script src=engine/engineObject.js?125></script>
|
|
13
|
-
<script src=engine/engineDraw.js?125></script>
|
|
14
|
-
<script src=engine/engineInput.js?125></script>
|
|
15
|
-
<script src=engine/engineAudio.js?125></script>
|
|
16
|
-
<script src=engine/engineTileLayer.js?125></script>
|
|
17
|
-
<script src=engine/engineParticles.js?125></script>
|
|
18
|
-
<script src=engine/engineMedals.js?125></script>
|
|
19
|
-
<script src=engine/engineWebGL.js?125></script>
|
|
20
|
-
<script src=engine/engine.js?125></script>
|
|
21
|
-
|
|
22
|
-
<!-- You can also include all engine scripts like this... -->
|
|
23
|
-
<!-- <script src=engine/engine.all.js></script> -->
|
|
24
|
-
|
|
25
|
-
<!-- Add your game scripts here -->
|
|
26
|
-
<script src=game.js?125></script>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|