melonjs 10.9.0 → 10.12.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.
Files changed (96) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +32 -25
  3. package/dist/melonjs.js +1635 -2383
  4. package/dist/melonjs.min.js +4 -4
  5. package/dist/melonjs.module.d.ts +929 -1504
  6. package/dist/melonjs.module.js +1581 -2344
  7. package/package.json +18 -18
  8. package/src/audio/audio.js +0 -1
  9. package/src/camera/camera2d.js +1 -16
  10. package/src/entity/entity.js +6 -11
  11. package/src/game.js +2 -2
  12. package/src/geometries/ellipse.js +19 -28
  13. package/src/geometries/line.js +5 -8
  14. package/src/geometries/path2d.js +14 -24
  15. package/src/geometries/poly.js +29 -47
  16. package/src/geometries/rectangle.js +25 -37
  17. package/src/geometries/roundrect.js +8 -12
  18. package/src/index.js +7 -2
  19. package/src/input/gamepad.js +3 -14
  20. package/src/input/keyboard.js +1 -9
  21. package/src/input/pointer.js +0 -1
  22. package/src/input/pointerevent.js +14 -23
  23. package/src/lang/deprecated.js +9 -6
  24. package/src/level/level.js +0 -9
  25. package/src/level/tiled/TMXGroup.js +0 -4
  26. package/src/level/tiled/TMXLayer.js +0 -8
  27. package/src/level/tiled/TMXObject.js +0 -3
  28. package/src/level/tiled/TMXTile.js +4 -5
  29. package/src/level/tiled/TMXTileMap.js +1 -7
  30. package/src/level/tiled/TMXTileset.js +0 -5
  31. package/src/level/tiled/TMXTilesetGroup.js +1 -4
  32. package/src/level/tiled/TMXUtils.js +1 -4
  33. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -3
  34. package/src/level/tiled/renderer/TMXIsometricRenderer.js +0 -1
  35. package/src/level/tiled/renderer/TMXRenderer.js +1 -7
  36. package/src/loader/loader.js +0 -11
  37. package/src/loader/loadingscreen.js +16 -5
  38. package/src/math/color.js +10 -30
  39. package/src/math/math.js +0 -10
  40. package/src/math/matrix2.js +12 -27
  41. package/src/math/matrix3.js +1 -22
  42. package/src/math/observable_vector2.js +0 -29
  43. package/src/math/observable_vector3.js +0 -29
  44. package/src/math/vector2.js +3 -40
  45. package/src/math/vector3.js +4 -41
  46. package/src/particles/emitter.js +11 -12
  47. package/src/physics/body.js +4 -5
  48. package/src/physics/bounds.js +5 -19
  49. package/src/physics/collision.js +1 -13
  50. package/src/physics/detector.js +6 -56
  51. package/src/physics/quadtree.js +0 -7
  52. package/src/physics/response.js +48 -0
  53. package/src/physics/sat.js +4 -4
  54. package/src/physics/world.js +0 -4
  55. package/src/plugin/plugin.js +0 -2
  56. package/src/polyfill/roundrect.js +4 -2
  57. package/src/renderable/GUI.js +11 -14
  58. package/src/renderable/collectable.js +1 -0
  59. package/src/renderable/colorlayer.js +9 -7
  60. package/src/renderable/container.js +38 -64
  61. package/src/renderable/dragndrop.js +1 -10
  62. package/src/renderable/imagelayer.js +8 -12
  63. package/src/renderable/light2d.js +118 -0
  64. package/src/renderable/renderable.js +27 -48
  65. package/src/renderable/sprite.js +17 -29
  66. package/src/renderable/trigger.js +10 -3
  67. package/src/state/stage.js +72 -6
  68. package/src/state/state.js +22 -23
  69. package/src/system/device.js +14 -53
  70. package/src/system/event.js +11 -0
  71. package/src/system/pooling.js +20 -9
  72. package/src/system/save.js +9 -11
  73. package/src/system/timer.js +239 -218
  74. package/src/text/bitmaptextdata.js +1 -4
  75. package/src/text/glyph.js +2 -2
  76. package/src/text/text.js +25 -24
  77. package/src/text/textmetrics.js +0 -2
  78. package/src/tweens/easing.js +1 -1
  79. package/src/tweens/interpolation.js +2 -2
  80. package/src/tweens/tween.js +1 -13
  81. package/src/utils/agent.js +1 -3
  82. package/src/utils/array.js +0 -3
  83. package/src/utils/file.js +0 -2
  84. package/src/utils/function.js +0 -2
  85. package/src/utils/string.js +0 -6
  86. package/src/utils/utils.js +0 -3
  87. package/src/video/canvas/canvas_renderer.js +73 -90
  88. package/src/video/renderer.js +34 -49
  89. package/src/video/{texture.js → texture/atlas.js} +10 -8
  90. package/src/video/{texture_cache.js → texture/cache.js} +4 -5
  91. package/src/video/texture/canvas_texture.js +99 -0
  92. package/src/video/video.js +3 -3
  93. package/src/video/webgl/glshader.js +0 -5
  94. package/src/video/webgl/utils/uniforms.js +3 -6
  95. package/src/video/webgl/webgl_compositor.js +0 -14
  96. package/src/video/webgl/webgl_renderer.js +73 -97
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (C) 2011 - 2020 Olivier Biot
3
+ Copyright (C) 2011 - 2022 Olivier Biot
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
package/README.md CHANGED
@@ -87,10 +87,34 @@ Tools integration
87
87
  Tools integration and usage with melonJS is documented in our [Wiki](https://github.com/melonjs/melonJS/wiki#third-party-tools-usage).
88
88
 
89
89
 
90
- Using melonJS
90
+ # Using melonJS
91
+
92
+ ### For your first time using melonJS, use either of these tutorials for setting up the engine. These are where you start.
93
+
94
+ - [Platformer](http://melonjs.github.io/tutorial-platformer/) Step by Step Tutorial.
95
+ - [Space Invaders](http://melonjs.github.io/tutorial-space-invaders/) Step by Step Tutorial.
96
+
97
+ You may find it useful to skim the overview found at the wiki [Details & Usage](https://github.com/melonjs/melonJS/wiki#details--usage)
98
+
99
+ When starting your own projects, checkout our [es6 boilerplate](https://github.com/melonjs/es6-boilerplate)
100
+
101
+ Demos
91
102
  -------------------------------------------------------------------------------
92
103
 
93
- Basic [Hello World](https://jsfiddle.net/obiot/4o9f02tc/) Example
104
+ A few demos of melonJS capabilities :
105
+
106
+ * [Platformer Demo](https://melonjs.github.io/examples/platformer/)
107
+ * [Isometric Demo](https://melonjs.github.io/examples/isometric_rpg/)
108
+ * [Sprite Demo](https://melonjs.github.io/examples/sprite/)
109
+ * [Masking Demo](https://melonjs.github.io/examples/masking/)
110
+ * [Primitive Drawing Demo](https://melonjs.github.io/examples/graphics/)
111
+ * [UI Demo](https://melonjs.github.io/examples/UI/)
112
+
113
+ More examples are available [here](https://melonjs.github.io/examples/)
114
+
115
+ -------------------------------------------------------------------------------
116
+
117
+ ### Basic [Hello World](https://jsfiddle.net/obiot/4o9f02tc/) Example
94
118
 
95
119
  ```JavaScript
96
120
  import * as me from "https://esm.run/melonjs";
@@ -118,32 +142,12 @@ me.device.onReady(function () {
118
142
  ```
119
143
  > Simple hello world using melonJS 2 (version 10.x or higher)
120
144
 
121
- Documentation :
122
-
123
- * [Online API](http://melonjs.github.io/melonJS/docs/) ([offline](https://github.com/melonjs/melonJS/archive/gh-pages.zip) version under the `docs` directory)
124
-
125
- For your first time using melonJS, follow these tutorials :
126
-
127
- - [Platformer](http://melonjs.github.io/tutorial-platformer/) Step by Step Tutorial.
128
- - [Space Invaders](http://melonjs.github.io/tutorial-space-invaders/) Step by Step Tutorial.
129
-
130
- You may find it useful to skim the overview found at the wiki [Details & Usage](https://github.com/melonjs/melonJS/wiki#details--usage)
131
-
132
- When starting your own projects, checkout our [es6 boilerplate](https://github.com/melonjs/es6-boilerplate)
133
-
134
- Demos
145
+ Documentation
135
146
  -------------------------------------------------------------------------------
136
147
 
137
- A few demos of melonJS capabilities :
138
-
139
- * [Platformer Demo](https://melonjs.github.io/examples/platformer/)
140
- * [Isometric Demo](https://melonjs.github.io/examples/isometric_rpg/)
141
- * [Sprite Demo](https://melonjs.github.io/examples/sprite/)
142
- * [Masking Demo](https://melonjs.github.io/examples/masking/)
143
- * [Primitive Drawing Demo](https://melonjs.github.io/examples/graphics/)
144
- * [UI Demo](https://melonjs.github.io/examples/UI/)
148
+ * [Online API](http://melonjs.github.io/melonJS/docs/)
149
+ * [offline](https://github.com/melonjs/melonJS/archive/gh-pages.zip) version under the `docs` directory)
145
150
 
146
- More examples are available [here](https://melonjs.github.io/examples/)
147
151
 
148
152
  Download melonJS
149
153
  -------------------------------------------------------------------------------
@@ -199,6 +203,7 @@ The generated library will be available under the `build` directory :
199
203
  - `melonjs.js` : plain ES5 UMD bundle
200
204
  - `melonjs.min.js` : minified ES5 UMD bundle
201
205
  - `melonjs.module.js` : plain ES6 module
206
+ - `melonjs.module.d.ts` : typescript declaration for the ES6 Module
202
207
 
203
208
  To run the melonJS test suite simply use the following:
204
209
 
@@ -208,6 +213,8 @@ This will run the jasmine spec tests with the output displayed on the shell. Do
208
213
  note that the latest Chrome version is required, as the test unit will run the
209
214
  Browser in a headless mode (in case of failed tests, upgrade your browser).
210
215
 
216
+ Last but not least, if you really want to contribute, but not sure how, you can
217
+ always check our [discussions](https://github.com/melonjs/melonJS/discussions/categories/ideas) list to get some idea on where to start.
211
218
 
212
219
  Building the documentation
213
220
  -------------------------------------------------------------------------------