littlejsengine 1.4.6 → 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 ADDED
@@ -0,0 +1,80 @@
1
+ # ![LittleJS Logo](favicon.png) LittleJS - The Tiny JavaScript Game Engine That Can
2
+
3
+ ## All aboard!
4
+
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>
10
+
11
+ ![LittleJS Screenshot](examples/screenshot.jpg)
12
+
13
+ ## Examples
14
+
15
+ ### [Hello World](https://killedbyapixel.github.io/LittleJS/) - Clean project with only a few things to get you started
16
+ ### [Puzzle Game](https://killedbyapixel.github.io/LittleJS/examples/puzzle) - Match 3 puzzle game with HD rendering and high score tracking
17
+ ### [Platformer](https://killedbyapixel.github.io/LittleJS/examples/platformer) - Platformer/shooter with procedural generation and destruction
18
+ ### [Breakout](https://killedbyapixel.github.io/LittleJS/examples/breakout) - Breakout game with post processing effect
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
21
+
22
+ ## Features
23
+
24
+ - Very small footprint with no dependencies
25
+ - Can update and render 10,000+ objects at 60fps, often many times more
26
+ - Object oriented system with fast 2D physics and collision handling for axis aligned boxes
27
+ - Positional audio effects with [ZzFX](https://killedbyapixel.github.io/ZzFX/) and music with [ZzFXM](https://keithclark.github.io/ZzFXM/), mp3s, or wavs
28
+ - Input processing system with keyboard, mouse, gamepad, and touch support
29
+ - Particle effects system (particle editor/designer in progress)
30
+ - Medal system tracks and displays achievements with Newgrounds integration
31
+ - Several easy to understand example projects you can build on
32
+ - Apply [Shadertoy](https://www.shadertoy.com) compatible shaders for post processinge effects
33
+ - Debug tools and debug rendering system
34
+ - [Full documentation](https://killedbyapixel.github.io/LittleJS/docs) automatically generated from the source code block tags with [JSDoc](https://github.com/jsdoc/jsdoc)
35
+ - Build system automatically combines everything, minifies, and removes unused code
36
+ - For size coding competitions like [js13kGames](https://js13kgames.com/), starter project builds to a 7KB zip file
37
+ - Easily build a Windows executable with [Electron](https://www.electronjs.org/) for distribution on platforms like Steam
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)
40
+
41
+ ## Builds
42
+
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.
44
+
45
+ - [engine.all.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.js) - The full game engine with debug mode available
46
+ - [engine.all.release.js](https://github.com/KilledByAPixel/LittleJS/blob/main/engine/engine.all.release.js) - The engine optimized for release builds
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
+
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
+
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.
55
+
56
+ ## Debugging
57
+
58
+ Debug builds of LittleJS have a special menu that can be opened by pressing ~, the tilde key.
59
+
60
+ - ~: Debug Overlay
61
+ - 1: Debug Physics
62
+ - 2: Debug Particles
63
+ - 3: Debug Gamepads
64
+ - 4: God Mode
65
+ - 5: Save Screenshot
66
+
67
+ ## Games Made With LittleJS
68
+
69
+ - [Space Huggers](https://www.newgrounds.com/portal/view/819609) - Run and gun platformer with procedural levels
70
+ - [Undergrowth](https://undergrowth.squidband.uk/) - An interactive music videogame for the band Squid
71
+ - [Space Huggers - JS13K Edition](https://github.com/KilledByAPixel/SpaceHuggers) - Original js13k game with source code
72
+ - [Isletopia](https://store.steampowered.com/app/1861260/Isletopia) - Relaxing strategy game of greenifying barren islands
73
+ - [Dead Again](https://js13kgames.com/entries/dead-again) - Top down survial horror by [sanojian & repsej](https://github.com/sanojian/js13k_2022)
74
+ - [Hel's Trial](https://js13kgames.com/entries/hels-trial) - Turn based RPG by [Sebastian Dorn](https://github.com/sebadorn/js13k-2022-death)
75
+ - [Bit Butcher](https://js13kgames.com/entries/bit-butcher) - Survival crafting game by [Deathray Games](https://github.com/deathraygames/bit-butcher)
76
+ - [Necrotic Commander](https://js13kgames.com/entries/necrotic-commander) - Tower defense game by [Daniel Jeffery](https://github.com/d-jeffery/NecroticCommander)
77
+ - [Boxing up Bamboo](https://patrickgh3.itch.io/boxing-up-bamboo) - A challenging puzzle game by [Patrick Traynor](https://cwpat.me/about)
78
+ - Send me your games!
79
+
80
+ ![LittleJS Logo](favicon.png)
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%.temp
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
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 (