melonjs 10.7.1 → 10.10.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 (74) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +29 -23
  3. package/dist/melonjs.js +2220 -1070
  4. package/dist/melonjs.min.js +4 -4
  5. package/dist/melonjs.module.d.ts +1395 -485
  6. package/dist/melonjs.module.js +2244 -1131
  7. package/package.json +17 -14
  8. package/src/camera/camera2d.js +1 -1
  9. package/src/entity/entity.js +6 -7
  10. package/src/game.js +2 -2
  11. package/src/geometries/ellipse.js +20 -21
  12. package/src/geometries/line.js +7 -7
  13. package/src/geometries/path2d.js +319 -0
  14. package/src/geometries/poly.js +27 -27
  15. package/src/geometries/rectangle.js +19 -19
  16. package/src/geometries/roundrect.js +164 -0
  17. package/src/index.js +12 -2
  18. package/src/input/gamepad.js +2 -2
  19. package/src/input/pointerevent.js +1 -1
  20. package/src/lang/deprecated.js +8 -6
  21. package/src/level/tiled/TMXLayer.js +1 -1
  22. package/src/level/tiled/TMXObject.js +9 -12
  23. package/src/level/tiled/TMXTileMap.js +23 -4
  24. package/src/level/tiled/TMXUtils.js +1 -1
  25. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
  26. package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
  27. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
  28. package/src/level/tiled/renderer/TMXRenderer.js +1 -1
  29. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -1
  30. package/src/loader/loader.js +4 -4
  31. package/src/loader/loadingscreen.js +17 -6
  32. package/src/math/color.js +6 -5
  33. package/src/math/matrix2.js +1 -1
  34. package/src/math/matrix3.js +1 -1
  35. package/src/math/observable_vector2.js +1 -1
  36. package/src/math/observable_vector3.js +1 -1
  37. package/src/math/vector2.js +1 -1
  38. package/src/math/vector3.js +1 -1
  39. package/src/particles/emitter.js +34 -26
  40. package/src/particles/particle.js +3 -2
  41. package/src/physics/body.js +67 -51
  42. package/src/physics/bounds.js +8 -9
  43. package/src/physics/world.js +1 -1
  44. package/src/polyfill/index.js +1 -0
  45. package/src/polyfill/roundrect.js +235 -0
  46. package/src/renderable/GUI.js +5 -5
  47. package/src/renderable/collectable.js +9 -2
  48. package/src/renderable/colorlayer.js +1 -1
  49. package/src/renderable/container.js +27 -27
  50. package/src/renderable/imagelayer.js +3 -3
  51. package/src/renderable/light2d.js +115 -0
  52. package/src/renderable/renderable.js +23 -22
  53. package/src/renderable/sprite.js +15 -16
  54. package/src/renderable/trigger.js +10 -4
  55. package/src/state/stage.js +73 -3
  56. package/src/state/state.js +1 -1
  57. package/src/system/device.js +10 -8
  58. package/src/system/pooling.js +156 -149
  59. package/src/text/bitmaptext.js +1 -1
  60. package/src/text/text.js +14 -18
  61. package/src/utils/utils.js +2 -2
  62. package/src/video/canvas/canvas_renderer.js +144 -81
  63. package/src/video/renderer.js +64 -37
  64. package/src/video/{texture.js → texture/atlas.js} +8 -8
  65. package/src/video/{texture_cache.js → texture/cache.js} +4 -4
  66. package/src/video/texture/canvas_texture.js +87 -0
  67. package/src/video/webgl/glshader.js +29 -193
  68. package/src/video/webgl/utils/attributes.js +16 -0
  69. package/src/video/webgl/utils/precision.js +11 -0
  70. package/src/video/webgl/utils/program.js +58 -0
  71. package/src/video/webgl/utils/string.js +16 -0
  72. package/src/video/webgl/utils/uniforms.js +87 -0
  73. package/src/video/webgl/webgl_compositor.js +1 -14
  74. package/src/video/webgl/webgl_renderer.js +191 -231
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";
@@ -122,28 +146,7 @@ Documentation :
122
146
 
123
147
  * [Online API](http://melonjs.github.io/melonJS/docs/) ([offline](https://github.com/melonjs/melonJS/archive/gh-pages.zip) version under the `docs` directory)
124
148
 
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
135
- -------------------------------------------------------------------------------
136
-
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/)
145
149
 
146
- More examples are available [here](https://melonjs.github.io/examples/)
147
150
 
148
151
  Download melonJS
149
152
  -------------------------------------------------------------------------------
@@ -199,6 +202,7 @@ The generated library will be available under the `build` directory :
199
202
  - `melonjs.js` : plain ES5 UMD bundle
200
203
  - `melonjs.min.js` : minified ES5 UMD bundle
201
204
  - `melonjs.module.js` : plain ES6 module
205
+ - `melonjs.module.d.ts` : typescript declaration for the ES6 Module
202
206
 
203
207
  To run the melonJS test suite simply use the following:
204
208
 
@@ -208,6 +212,8 @@ This will run the jasmine spec tests with the output displayed on the shell. Do
208
212
  note that the latest Chrome version is required, as the test unit will run the
209
213
  Browser in a headless mode (in case of failed tests, upgrade your browser).
210
214
 
215
+ Last but not least, if you really want to contribute, but not sure how, you can
216
+ always check our [discussions](https://github.com/melonjs/melonJS/discussions/categories/ideas) list to get some idea on where to start.
211
217
 
212
218
  Building the documentation
213
219
  -------------------------------------------------------------------------------