littlejsengine 1.4.91 → 1.5.1
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 +1 -0
- package/build.bat +4 -6
- package/engine/engine.all.js +202 -105
- package/engine/engine.all.min.js +1 -1
- package/engine/engine.all.module.js +385 -181
- package/engine/engine.all.module.min.js +1 -1
- package/engine/engine.all.release.js +192 -100
- package/engine/engine.js +47 -16
- package/engine/engineAudio.js +14 -1
- package/engine/engineBuild.bat +8 -8
- package/engine/engineDebug.js +10 -5
- package/engine/engineDraw.js +25 -27
- package/engine/engineExport.js +183 -76
- package/engine/engineInput.js +6 -1
- package/engine/engineMedals.js +1 -0
- package/engine/engineObject.js +11 -9
- package/engine/engineParticles.js +5 -5
- package/engine/engineSettings.js +46 -20
- package/engine/engineTileLayer.js +13 -12
- package/engine/engineUtilities.js +13 -7
- package/engine/engineWebGL.js +11 -2
- package/engine/index.d.ts +1788 -1700
- package/examples/breakout/game.js +3 -1
- package/examples/breakout/index.html +4 -4
- package/examples/empty/index.html +1 -4
- package/examples/module/game.js +1 -4
- package/examples/module/index.html +2 -2
- package/examples/particles/index.html +2 -2
- package/examples/platformer/game.js +2 -0
- package/examples/platformer/gameObjects.js +3 -3
- package/examples/platformer/index.html +7 -7
- package/examples/puzzle/index.html +3 -3
- package/examples/stress/index.html +5 -5
- package/examples/typescript/build.bat +14 -0
- package/examples/typescript/game.js +89 -0
- package/examples/typescript/game.ts +117 -0
- package/examples/typescript/index.html +9 -0
- package/examples/typescript/tiles.png +0 -0
- package/examples/typescript/tsconfig.json +8 -0
- package/index.html +14 -14
- package/package.json +6 -6
package/engine/engineExport.js
CHANGED
|
@@ -4,43 +4,187 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Setters for all variables that devs will need to modify
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/** Set position of camera in world space
|
|
10
|
+
* @param {Vector2} pos
|
|
11
|
+
* @memberof Settings */
|
|
12
|
+
const setCameraPos = (pos)=> cameraPos = pos;
|
|
13
|
+
|
|
14
|
+
/** Set scale of camera in world space
|
|
15
|
+
* @param {Number} scale
|
|
16
|
+
* @memberof Settings */
|
|
17
|
+
const setCameraScale = (scale)=> cameraScale = scale;
|
|
18
|
+
|
|
19
|
+
/** Set max size of the canvas
|
|
20
|
+
* @param {Vector2} size
|
|
21
|
+
* @memberof Settings */
|
|
22
|
+
const setCanvasMaxSize = (size)=> canvasMaxSize = size;
|
|
23
|
+
|
|
24
|
+
/** Set fixed size of the canvas
|
|
25
|
+
* @param {Vector2} size
|
|
26
|
+
* @memberof Settings */
|
|
27
|
+
const setCanvasFixedSize = (size)=> canvasFixedSize = size;
|
|
28
|
+
|
|
29
|
+
/** Disables anti aliasing for pixel art if true
|
|
30
|
+
* @param {Boolean} pixelated
|
|
31
|
+
* @memberof Settings */
|
|
32
|
+
const setCavasPixelated = (pixelated)=> cavasPixelated = pixelated;
|
|
33
|
+
|
|
34
|
+
/** Set default font used for text rendering
|
|
35
|
+
* @param {String} font
|
|
36
|
+
* @memberof Settings */
|
|
37
|
+
const setFontDefault = (font)=> fontDefault = font;
|
|
38
|
+
|
|
39
|
+
/** Set if webgl rendering is enabled
|
|
40
|
+
* @param {Boolean} enable
|
|
41
|
+
* @memberof Settings */
|
|
42
|
+
const setGlEnable = (enable)=> glEnable = enable;
|
|
43
|
+
|
|
44
|
+
/** Set to not composite the WebGL canvas
|
|
45
|
+
* @param {Boolean} overlay
|
|
46
|
+
* @memberof Settings */
|
|
47
|
+
const setGlOverlay = (overlay)=> glOverlay = overlay;
|
|
48
|
+
|
|
49
|
+
/** Set default size of tiles in pixels
|
|
50
|
+
* @param {Vector2} size
|
|
51
|
+
* @memberof Settings */
|
|
52
|
+
const setTileSizeDefault = (size)=> tileSizeDefault = size;
|
|
53
|
+
|
|
54
|
+
/** Set to prevent tile bleeding from neighbors in pixels
|
|
55
|
+
* @param {Number} scale
|
|
56
|
+
* @memberof Settings */
|
|
57
|
+
const setTileFixBleedScale = (scale)=> tileFixBleedScale = scale;
|
|
58
|
+
|
|
59
|
+
/** Set if collisions between objects are enabled
|
|
60
|
+
* @param {Boolean} enable
|
|
61
|
+
* @memberof Settings */
|
|
62
|
+
const setEnablePhysicsSolver = (enable)=> enablePhysicsSolver = enable;
|
|
63
|
+
|
|
64
|
+
/** Set default object mass for collison calcuations
|
|
65
|
+
* @param {Number} mass
|
|
66
|
+
* @memberof Settings */
|
|
67
|
+
const setObjectDefaultMass = (mass)=> objectDefaultMass = mass;
|
|
68
|
+
|
|
69
|
+
/** Set how much to slow velocity by each frame
|
|
70
|
+
* @param {Number} damping
|
|
71
|
+
* @memberof Settings */
|
|
72
|
+
const setObjectDefaultDamping = (damp)=> objectDefaultDamping = damp;
|
|
73
|
+
|
|
74
|
+
/** Set how much to slow angular velocity each frame
|
|
75
|
+
* @param {Number} damping
|
|
76
|
+
* @memberof Settings */
|
|
77
|
+
const setObjectDefaultAngleDamping = (damp)=> objectDefaultAngleDamping = damp;
|
|
78
|
+
|
|
79
|
+
/** Set how much to bounce when a collision occur
|
|
80
|
+
* @param {Number} elasticity
|
|
81
|
+
* @memberof Settings */
|
|
82
|
+
const setObjectDefaultElasticity = (elasticity)=> objectDefaultElasticity = elasticity;
|
|
83
|
+
|
|
84
|
+
/** Set how much to slow when touching
|
|
85
|
+
* @param {Number} friction
|
|
86
|
+
* @memberof Settings */
|
|
87
|
+
const setObjectDefaultFriction = (friction)=> objectDefaultFriction = friction;
|
|
88
|
+
|
|
89
|
+
/** Set max speed to avoid fast objects missing collisions
|
|
90
|
+
* @param {Number} speed
|
|
91
|
+
* @memberof Settings */
|
|
92
|
+
const setObjectMaxSpeed = (speed)=> objectMaxSpeed = speed;
|
|
93
|
+
|
|
94
|
+
/** Set how much gravity to apply to objects along the Y axis
|
|
95
|
+
* @param {Number} gravity
|
|
96
|
+
* @memberof Settings */
|
|
97
|
+
const setGravity = (g)=> gravity = g;
|
|
98
|
+
|
|
99
|
+
/** Set to scales emit rate of particles
|
|
100
|
+
* @param {Number} scale
|
|
101
|
+
* @memberof Settings */
|
|
102
|
+
const setParticleEmitRateScale = (scale)=> particleEmitRateScale = scale;
|
|
103
|
+
|
|
104
|
+
/** Set if gamepads are enabled
|
|
105
|
+
* @param {Boolean} enable
|
|
106
|
+
* @memberof Settings */
|
|
107
|
+
const setGamepadsEnable = (enable)=> gamepadsEnable = enable;
|
|
108
|
+
|
|
109
|
+
/** Set if the dpad input is also routed to the left analog stick
|
|
110
|
+
* @param {Boolean} enable
|
|
111
|
+
* @memberof Settings */
|
|
112
|
+
const setGamepadDirectionEmulateStick = (enable)=> gamepadDirectionEmulateStick = enable;
|
|
113
|
+
|
|
114
|
+
/** Set if true the WASD keys are also routed to the direction keys
|
|
115
|
+
* @param {Boolean} enable
|
|
116
|
+
* @memberof Settings */
|
|
117
|
+
const setInputWASDEmulateDirection = (enable)=> inputWASDEmulateDirection = enable;
|
|
118
|
+
|
|
119
|
+
/** Set if touch gamepad should appear on mobile devices
|
|
120
|
+
* @param {Boolean} enable
|
|
121
|
+
* @memberof Settings */
|
|
122
|
+
const setTouchGamepadEnable = (enable)=> touchGamepadEnable = enable;
|
|
123
|
+
|
|
124
|
+
/** Set if touch gamepad should be analog stick or 8 way dpad
|
|
125
|
+
* @param {Boolean} analog
|
|
126
|
+
* @memberof Settings */
|
|
127
|
+
const setTouchGamepadAnalog = (analog)=> touchGamepadAnalog = analog;
|
|
128
|
+
|
|
129
|
+
/** Set size of virutal gamepad for touch devices in pixels
|
|
130
|
+
* @param {Number} size
|
|
131
|
+
* @memberof Settings */
|
|
132
|
+
const setTouchGamepadSize = (size)=> touchGamepadSize = size;
|
|
133
|
+
|
|
134
|
+
/** Set transparency of touch gamepad overlay
|
|
135
|
+
* @param {Number} alpha
|
|
136
|
+
* @memberof Settings */
|
|
137
|
+
const setTouchGamepadAlpha = (alpha)=> touchGamepadAlpha = alpha;
|
|
138
|
+
|
|
139
|
+
/** Set to allow vibration hardware if it exists
|
|
140
|
+
* @param {Boolean} enable
|
|
141
|
+
* @memberof Settings */
|
|
142
|
+
const setVibrateEnable = (enable)=> vibrateEnable = enable;
|
|
143
|
+
|
|
144
|
+
/** Set to disable all audio code
|
|
145
|
+
* @param {Boolean} enable
|
|
146
|
+
* @memberof Settings */
|
|
147
|
+
const setSoundEnable = (enable)=> soundEnable = enable;
|
|
148
|
+
|
|
149
|
+
/** Set volume scale to apply to all sound, music and speech
|
|
150
|
+
* @param {Number} volume
|
|
151
|
+
* @memberof Settings */
|
|
152
|
+
const setSoundVolume = (volume)=> soundVolume = volume;
|
|
153
|
+
|
|
154
|
+
/** Set default range where sound no longer plays
|
|
155
|
+
* @param {Number} range
|
|
156
|
+
* @memberof Settings */
|
|
157
|
+
const setSoundDefaultRange = (range)=> soundDefaultRange = range;
|
|
158
|
+
|
|
159
|
+
/** Set default range percent to start tapering off sound
|
|
160
|
+
* @param {Number} taper
|
|
161
|
+
* @memberof Settings */
|
|
162
|
+
const setSoundDefaultTaper = (taper)=> soundDefaultTaper = taper;
|
|
163
|
+
|
|
164
|
+
/** Set how long to show medals for in seconds
|
|
165
|
+
* @param {Number} time
|
|
166
|
+
* @memberof Settings */
|
|
167
|
+
const setMedalDisplayTime = (time)=> medalDisplayTime = time;
|
|
168
|
+
|
|
169
|
+
/** Set how quickly to slide on/off medals in seconds
|
|
170
|
+
* @param {Number} time
|
|
171
|
+
* @memberof Settings */
|
|
172
|
+
const setMedalDisplaySlideTime = (time)=> medalDisplaySlideTime = time;
|
|
173
|
+
|
|
174
|
+
/** Set size of medal display
|
|
175
|
+
* @param {Vector2} size
|
|
176
|
+
* @memberof Settings */
|
|
177
|
+
const setMedalDisplaySize = (size)=> medalDisplaySize = size;
|
|
178
|
+
|
|
179
|
+
/** Set size of icon in medal display
|
|
180
|
+
* @param {Number} size
|
|
181
|
+
* @memberof Settings */
|
|
182
|
+
const setMedalDisplayIconSize = (size)=> medalDisplayIconSize = size;
|
|
183
|
+
|
|
184
|
+
/** Set to stop medals from being unlockable
|
|
185
|
+
* @param {Boolean} preventUnlock
|
|
186
|
+
* @memberof Settings */
|
|
187
|
+
const setMedalsPreventUnlock = (prevent)=> medalsPreventUnlock = prevent;
|
|
44
188
|
|
|
45
189
|
export {
|
|
46
190
|
// Setters for global variables
|
|
@@ -54,7 +198,6 @@ export {
|
|
|
54
198
|
setGlOverlay,
|
|
55
199
|
setTileSizeDefault,
|
|
56
200
|
setTileFixBleedScale,
|
|
57
|
-
setObjectDefaultSize,
|
|
58
201
|
setEnablePhysicsSolver,
|
|
59
202
|
setObjectDefaultMass,
|
|
60
203
|
setObjectDefaultDamping,
|
|
@@ -89,7 +232,6 @@ export {
|
|
|
89
232
|
fontDefault,
|
|
90
233
|
tileSizeDefault,
|
|
91
234
|
tileFixBleedScale,
|
|
92
|
-
objectDefaultSize,
|
|
93
235
|
enablePhysicsSolver,
|
|
94
236
|
objectDefaultMass,
|
|
95
237
|
objectDefaultDamping,
|
|
@@ -124,17 +266,9 @@ export {
|
|
|
124
266
|
debug,
|
|
125
267
|
showWatermark,
|
|
126
268
|
godMode,
|
|
269
|
+
|
|
127
270
|
// Debug
|
|
128
|
-
|
|
129
|
-
//debugOverlay,
|
|
130
|
-
//debugPhysics,
|
|
131
|
-
//debugRaycast,
|
|
132
|
-
//debugParticles,
|
|
133
|
-
//debugGamepads,
|
|
134
|
-
//debugMedals,
|
|
135
|
-
//debugTakeScreenshot,
|
|
136
|
-
//downloadLink,
|
|
137
|
-
//ASSERT,
|
|
271
|
+
ASSERT,
|
|
138
272
|
debugRect,
|
|
139
273
|
debugCircle,
|
|
140
274
|
debugPoint,
|
|
@@ -143,9 +277,6 @@ export {
|
|
|
143
277
|
debugText,
|
|
144
278
|
debugClear,
|
|
145
279
|
debugSaveCanvas,
|
|
146
|
-
//debugInit,
|
|
147
|
-
//debugUpdate,
|
|
148
|
-
//debugRender,
|
|
149
280
|
|
|
150
281
|
// Utilities
|
|
151
282
|
PI,
|
|
@@ -225,18 +356,6 @@ export {
|
|
|
225
356
|
gamepadWasPressed,
|
|
226
357
|
gamepadWasReleased,
|
|
227
358
|
gamepadStick,
|
|
228
|
-
//inputData,
|
|
229
|
-
//inputUpdate,
|
|
230
|
-
//inputUpdatePost,
|
|
231
|
-
// onkeydown,
|
|
232
|
-
// onkeyup,
|
|
233
|
-
//remapKeyCode,
|
|
234
|
-
// onmousedown,
|
|
235
|
-
// onmouseup,
|
|
236
|
-
// onmousemove,
|
|
237
|
-
// onwheel,
|
|
238
|
-
// oncontextmenu,
|
|
239
|
-
//stickData,
|
|
240
359
|
mouseToScreen,
|
|
241
360
|
gamepadsUpdate,
|
|
242
361
|
vibrate,
|
|
@@ -253,9 +372,6 @@ export {
|
|
|
253
372
|
audioContext,
|
|
254
373
|
playSamples,
|
|
255
374
|
zzfx,
|
|
256
|
-
//zzfxR,
|
|
257
|
-
//zzfxG,
|
|
258
|
-
//zzfxM,
|
|
259
375
|
|
|
260
376
|
// Tiles
|
|
261
377
|
tileCollision,
|
|
@@ -278,25 +394,17 @@ export {
|
|
|
278
394
|
medalsInit,
|
|
279
395
|
newgroundsInit,
|
|
280
396
|
Medal,
|
|
281
|
-
//medalsRender,
|
|
282
397
|
Newgrounds,
|
|
283
|
-
//CryptoJS,
|
|
284
398
|
|
|
285
399
|
// WebGL
|
|
286
400
|
glCanvas,
|
|
287
401
|
glContext,
|
|
288
|
-
//glInit,
|
|
289
402
|
glSetBlendMode,
|
|
290
403
|
glSetTexture,
|
|
291
404
|
glCompileShader,
|
|
292
405
|
glCreateProgram,
|
|
293
406
|
glCreateTexture,
|
|
294
|
-
//glPreRender,
|
|
295
|
-
//glFlush,
|
|
296
|
-
//glCopyToContext,
|
|
297
|
-
//glDraw,
|
|
298
407
|
glInitPostProcess,
|
|
299
|
-
//glRenderPostProcess,
|
|
300
408
|
|
|
301
409
|
// Engine
|
|
302
410
|
engineName,
|
|
@@ -304,7 +412,6 @@ export {
|
|
|
304
412
|
frameRate,
|
|
305
413
|
timeDelta,
|
|
306
414
|
engineObjects,
|
|
307
|
-
//engineObjectsCollide,
|
|
308
415
|
frame,
|
|
309
416
|
time,
|
|
310
417
|
timeReal,
|
package/engine/engineInput.js
CHANGED
|
@@ -35,18 +35,21 @@ const keyWasReleased = (key, device=0)=> inputData[device] && inputData[device][
|
|
|
35
35
|
const clearInput = ()=> inputData = [[]];
|
|
36
36
|
|
|
37
37
|
/** Returns true if mouse button is down
|
|
38
|
+
* @function
|
|
38
39
|
* @param {Number} button
|
|
39
40
|
* @return {Boolean}
|
|
40
41
|
* @memberof Input */
|
|
41
42
|
const mouseIsDown = keyIsDown;
|
|
42
43
|
|
|
43
44
|
/** Returns true if mouse button was pressed
|
|
45
|
+
* @function
|
|
44
46
|
* @param {Number} button
|
|
45
47
|
* @return {Boolean}
|
|
46
48
|
* @memberof Input */
|
|
47
49
|
const mouseWasPressed = keyWasPressed;
|
|
48
50
|
|
|
49
51
|
/** Returns true if mouse button was released
|
|
52
|
+
* @function
|
|
50
53
|
* @param {Number} button
|
|
51
54
|
* @return {Boolean}
|
|
52
55
|
* @memberof Input */
|
|
@@ -63,14 +66,17 @@ let mousePos = vec2();
|
|
|
63
66
|
let mousePosScreen = vec2();
|
|
64
67
|
|
|
65
68
|
/** Mouse wheel delta this frame
|
|
69
|
+
* @type {Number}
|
|
66
70
|
* @memberof Input */
|
|
67
71
|
let mouseWheel = 0;
|
|
68
72
|
|
|
69
73
|
/** Returns true if user is using gamepad (has more recently pressed a gamepad button)
|
|
74
|
+
* @type {Boolean}
|
|
70
75
|
* @memberof Input */
|
|
71
76
|
let isUsingGamepad = 0;
|
|
72
77
|
|
|
73
78
|
/** Prevents input continuing to the default browser handling (false by default)
|
|
79
|
+
* @type {Boolean}
|
|
74
80
|
* @memberof Input */
|
|
75
81
|
let preventDefaultInput = 0;
|
|
76
82
|
|
|
@@ -246,7 +252,6 @@ const vibrateStop = ()=> vibrate(0);
|
|
|
246
252
|
// Touch input
|
|
247
253
|
|
|
248
254
|
/** True if a touch device has been detected
|
|
249
|
-
* @const {boolean}
|
|
250
255
|
* @memberof Input */
|
|
251
256
|
const isTouchDevice = window.ontouchstart !== undefined;
|
|
252
257
|
|
package/engine/engineMedals.js
CHANGED
package/engine/engineObject.js
CHANGED
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
class EngineObject
|
|
33
33
|
{
|
|
34
34
|
/** Create an engine object and adds it to the list of objects
|
|
35
|
-
* @param {Vector2} [position=
|
|
36
|
-
* @param {Vector2} [size=
|
|
35
|
+
* @param {Vector2} [position=Vector2()] - World space position of the object
|
|
36
|
+
* @param {Vector2} [size=Vector2(1,1)] - World space size of the object
|
|
37
37
|
* @param {Number} [tileIndex=-1] - Tile to use to render object (-1 is untextured)
|
|
38
38
|
* @param {Vector2} [tileSize=tileSizeDefault] - Size of tile in source pixels
|
|
39
39
|
* @param {Number} [angle=0] - Angle the object is rotated by
|
|
40
|
-
* @param {Color} [color]
|
|
40
|
+
* @param {Color} [color=Color()] - Color to apply to tile when rendered
|
|
41
41
|
* @param {Number} [renderOrder=0] - Objects sorted by renderOrder before being rendered
|
|
42
42
|
*/
|
|
43
|
-
constructor(pos=vec2(), size=
|
|
43
|
+
constructor(pos=vec2(), size=vec2(1), tileIndex=-1, tileSize=tileSizeDefault, angle=0, color, renderOrder=0)
|
|
44
44
|
{
|
|
45
45
|
// set passed in params
|
|
46
46
|
ASSERT(isVector2(pos) && isVector2(size)); // ensure pos and size are vec2s
|
|
@@ -77,7 +77,7 @@ class EngineObject
|
|
|
77
77
|
this.gravityScale = 1;
|
|
78
78
|
/** @property {Number} [renderOrder=0] - Objects are sorted by render order */
|
|
79
79
|
this.renderOrder = renderOrder;
|
|
80
|
-
/** @property {Vector2} [velocity=
|
|
80
|
+
/** @property {Vector2} [velocity=Vector2()] - Velocity of the object */
|
|
81
81
|
this.velocity = new Vector2();
|
|
82
82
|
/** @property {Number} [angleVelocity=0] - Angular velocity of the object */
|
|
83
83
|
this.angleVelocity = 0;
|
|
@@ -320,7 +320,7 @@ class EngineObject
|
|
|
320
320
|
|
|
321
321
|
/** Attaches a child to this with a given local transform
|
|
322
322
|
* @param {EngineObject} child
|
|
323
|
-
* @param {Vector2} [localPos=
|
|
323
|
+
* @param {Vector2} [localPos=Vector2()]
|
|
324
324
|
* @param {Number} [localAngle=0] */
|
|
325
325
|
addChild(child, localPos=vec2(), localAngle=0)
|
|
326
326
|
{
|
|
@@ -341,9 +341,9 @@ class EngineObject
|
|
|
341
341
|
}
|
|
342
342
|
|
|
343
343
|
/** Set how this object collides
|
|
344
|
-
* @param {
|
|
345
|
-
* @param {
|
|
346
|
-
* @param {
|
|
344
|
+
* @param {Boolean} [collideSolidObjects=1] - Does it collide with solid objects
|
|
345
|
+
* @param {Boolean} [isSolid=1] - Does it collide with and block other objects (expensive in large numbers)
|
|
346
|
+
* @param {Boolean} [collideTiles=1] - Does it collide with the tile collision */
|
|
347
347
|
setCollision(collideSolidObjects=1, isSolid=1, collideTiles=1)
|
|
348
348
|
{
|
|
349
349
|
ASSERT(collideSolidObjects || !isSolid); // solid objects must be set to collide
|
|
@@ -353,6 +353,8 @@ class EngineObject
|
|
|
353
353
|
this.collideTiles = collideTiles;
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
+
/** Returns string containg info about this object for debugging
|
|
357
|
+
* @return {String} */
|
|
356
358
|
toString()
|
|
357
359
|
{
|
|
358
360
|
if (debug)
|
|
@@ -34,11 +34,11 @@ class ParticleEmitter extends EngineObject
|
|
|
34
34
|
* @param {Number} [emitRate=100] - How many particles per second to spawn, does not emit if 0
|
|
35
35
|
* @param {Number} [emitConeAngle=PI] - Local angle to apply velocity to particles from emitter
|
|
36
36
|
* @param {Number} [tileIndex=-1] - Index into tile sheet, if <0 no texture is applied
|
|
37
|
-
* @param {
|
|
38
|
-
* @param {Color} [colorStartA=
|
|
39
|
-
* @param {Color} [colorStartB=
|
|
40
|
-
* @param {Color} [colorEndA=
|
|
41
|
-
* @param {Color} [colorEndB=
|
|
37
|
+
* @param {Vector2} [tileSize=tileSizeDefault] - Tile size for particles
|
|
38
|
+
* @param {Color} [colorStartA=Color()] - Color at start of life 1, randomized between start colors
|
|
39
|
+
* @param {Color} [colorStartB=Color()] - Color at start of life 2, randomized between start colors
|
|
40
|
+
* @param {Color} [colorEndA=Color(1,1,1,0)] - Color at end of life 1, randomized between end colors
|
|
41
|
+
* @param {Color} [colorEndB=Color(1,1,1,0)] - Color at end of life 2, randomized between end colors
|
|
42
42
|
* @param {Number} [particleTime=.5] - How long particles live
|
|
43
43
|
* @param {Number} [sizeStart=.1] - How big are particles at start
|
|
44
44
|
* @param {Number} [sizeEnd=1] - How big are particles at end
|