@vpmedia/phaser 1.0.39 → 1.0.41
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 -1
- package/dist/phaser.cjs +1 -1
- package/dist/phaser.cjs.LICENSE.txt +1 -1
- package/dist/phaser.cjs.map +1 -1
- package/dist/phaser.js +1 -1
- package/dist/phaser.js.LICENSE.txt +1 -1
- package/dist/phaser.js.map +1 -1
- package/package.json +1 -1
- package/src/phaser/core/cache.js +10 -62
- package/src/phaser/core/const.js +0 -9
- package/src/phaser/core/game.js +3 -22
- package/src/phaser/core/loader.js +2 -2
- package/src/phaser/core/scene.js +0 -24
- package/src/phaser/core/scene_manager.js +4 -73
- package/src/phaser/core/time.js +0 -6
- package/src/phaser/core/tween.js +0 -1
- package/src/phaser/core/tween_data.js +1 -1
- package/src/phaser/core/tween_manager.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/phaser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
4
4
|
"description": "@vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2",
|
|
5
5
|
"author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
|
|
6
6
|
"license": "MIT",
|
package/src/phaser/core/cache.js
CHANGED
|
@@ -11,20 +11,16 @@ import FrameData from './frame_data';
|
|
|
11
11
|
import { JSONDataHash } from './animation_parser';
|
|
12
12
|
import { jsonBitmapFont, xmlBitmapFont } from './loader_parser';
|
|
13
13
|
|
|
14
|
-
export const CANVAS =
|
|
15
|
-
export const IMAGE =
|
|
16
|
-
export const TEXTURE =
|
|
17
|
-
export const SOUND =
|
|
18
|
-
export const TEXT =
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const JSON = 11;
|
|
25
|
-
export const XML = 12;
|
|
26
|
-
export const SHADER = 14;
|
|
27
|
-
export const RENDER_TEXTURE = 15;
|
|
14
|
+
export const CANVAS = 0;
|
|
15
|
+
export const IMAGE = 1;
|
|
16
|
+
export const TEXTURE = 2;
|
|
17
|
+
export const SOUND = 3;
|
|
18
|
+
export const TEXT = 4;
|
|
19
|
+
export const BITMAPDATA = 5;
|
|
20
|
+
export const BITMAPFONT = 6;
|
|
21
|
+
export const JSON = 7;
|
|
22
|
+
export const XML = 8;
|
|
23
|
+
export const RENDER_TEXTURE = 9;
|
|
28
24
|
|
|
29
25
|
export default class {
|
|
30
26
|
|
|
@@ -39,12 +35,8 @@ export default class {
|
|
|
39
35
|
text: {},
|
|
40
36
|
json: {},
|
|
41
37
|
xml: {},
|
|
42
|
-
physics: {},
|
|
43
|
-
tilemap: {},
|
|
44
|
-
binary: {},
|
|
45
38
|
bitmapData: {},
|
|
46
39
|
bitmapFont: {},
|
|
47
|
-
shader: {},
|
|
48
40
|
renderTexture: {},
|
|
49
41
|
};
|
|
50
42
|
this._urlMap = {};
|
|
@@ -57,14 +49,10 @@ export default class {
|
|
|
57
49
|
this._cacheMap[TEXTURE] = this._cache.texture;
|
|
58
50
|
this._cacheMap[SOUND] = this._cache.sound;
|
|
59
51
|
this._cacheMap[TEXT] = this._cache.text;
|
|
60
|
-
this._cacheMap[PHYSICS] = this._cache.physics;
|
|
61
|
-
this._cacheMap[TILEMAP] = this._cache.tilemap;
|
|
62
|
-
this._cacheMap[BINARY] = this._cache.binary;
|
|
63
52
|
this._cacheMap[BITMAPDATA] = this._cache.bitmapData;
|
|
64
53
|
this._cacheMap[BITMAPFONT] = this._cache.bitmapFont;
|
|
65
54
|
this._cacheMap[JSON] = this._cache.json;
|
|
66
55
|
this._cacheMap[XML] = this._cache.xml;
|
|
67
|
-
this._cacheMap[SHADER] = this._cache.shader;
|
|
68
56
|
this._cacheMap[RENDER_TEXTURE] = this._cache.renderTexture;
|
|
69
57
|
this.addDefaultImage();
|
|
70
58
|
this.addMissingImage();
|
|
@@ -134,10 +122,6 @@ export default class {
|
|
|
134
122
|
this._resolveURL(url, this._cache.text[key]);
|
|
135
123
|
}
|
|
136
124
|
|
|
137
|
-
addBinary(key, binaryData) {
|
|
138
|
-
this._cache.binary[key] = binaryData;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
125
|
addBitmapFont(key, url, data, atlasData, atlasType, xSpacing = 0, ySpacing = 0) {
|
|
142
126
|
const obj = {
|
|
143
127
|
url,
|
|
@@ -250,14 +234,6 @@ export default class {
|
|
|
250
234
|
return this.checkKey(TEXT, key);
|
|
251
235
|
}
|
|
252
236
|
|
|
253
|
-
checkTilemapKey(key) {
|
|
254
|
-
return this.checkKey(TILEMAP, key);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
checkBinaryKey(key) {
|
|
258
|
-
return this.checkKey(BINARY, key);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
237
|
checkBitmapDataKey(key) {
|
|
262
238
|
return this.checkKey(BITMAPDATA, key);
|
|
263
239
|
}
|
|
@@ -317,14 +293,6 @@ export default class {
|
|
|
317
293
|
return this.getItem(key, TEXT, 'getText', 'data');
|
|
318
294
|
}
|
|
319
295
|
|
|
320
|
-
getTilemapData(key) {
|
|
321
|
-
return this.getItem(key, TILEMAP, 'getTilemapData');
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
getBinary(key) {
|
|
325
|
-
return this.getItem(key, BINARY, 'getBinary');
|
|
326
|
-
}
|
|
327
|
-
|
|
328
296
|
getBitmapData(key) {
|
|
329
297
|
return this.getItem(key, BITMAPDATA, 'getBitmapData', 'data');
|
|
330
298
|
}
|
|
@@ -342,10 +310,6 @@ export default class {
|
|
|
342
310
|
return this.getItem(key, XML, 'getXML', 'data');
|
|
343
311
|
}
|
|
344
312
|
|
|
345
|
-
getShader(key) {
|
|
346
|
-
return this.getItem(key, SHADER, 'getShader', 'data');
|
|
347
|
-
}
|
|
348
|
-
|
|
349
313
|
getRenderTexture(key) {
|
|
350
314
|
return this.getItem(key, RENDER_TEXTURE, 'getRenderTexture');
|
|
351
315
|
}
|
|
@@ -443,18 +407,6 @@ export default class {
|
|
|
443
407
|
delete this._cache.text[key];
|
|
444
408
|
}
|
|
445
409
|
|
|
446
|
-
removePhysics(key) {
|
|
447
|
-
delete this._cache.physics[key];
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
removeTilemap(key) {
|
|
451
|
-
delete this._cache.tilemap[key];
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
removeBinary(key) {
|
|
455
|
-
delete this._cache.binary[key];
|
|
456
|
-
}
|
|
457
|
-
|
|
458
410
|
removeBitmapData(key) {
|
|
459
411
|
delete this._cache.bitmapData[key];
|
|
460
412
|
}
|
|
@@ -471,10 +423,6 @@ export default class {
|
|
|
471
423
|
delete this._cache.xml[key];
|
|
472
424
|
}
|
|
473
425
|
|
|
474
|
-
removeShader(key) {
|
|
475
|
-
delete this._cache.shader[key];
|
|
476
|
-
}
|
|
477
|
-
|
|
478
426
|
removeRenderTexture(key) {
|
|
479
427
|
delete this._cache.renderTexture[key];
|
|
480
428
|
}
|
package/src/phaser/core/const.js
CHANGED
|
@@ -87,13 +87,4 @@ export const GEOM_ROUNDED_RECTANGLE = 26;
|
|
|
87
87
|
export const GEOM_LINE = 23;
|
|
88
88
|
export const GEOM_MATRIX = 24;
|
|
89
89
|
export const GEOM_POINT = 25;
|
|
90
|
-
export const BITMAP_DATA = 13; // deprecated
|
|
91
|
-
export const TILEMAP = 9; // deprecated
|
|
92
|
-
export const TILEMAP_LAYER = 10; // deprecated
|
|
93
|
-
export const EMITTER = 11; // deprecated
|
|
94
|
-
export const RETROFONT = 18; // deprecated
|
|
95
|
-
export const ROPE = 20; // deprecated
|
|
96
|
-
export const CREATURE = 27; // deprecated
|
|
97
90
|
export const PENDING_ATLAS = -1;
|
|
98
|
-
// sprite sheet atlas
|
|
99
|
-
export const TEXTURE_ATLAS_JSON_HASH = 1;
|
package/src/phaser/core/game.js
CHANGED
|
@@ -245,31 +245,21 @@ export default class {
|
|
|
245
245
|
this.time.update(time);
|
|
246
246
|
if (this.isKickStart) {
|
|
247
247
|
this.updateLogic(this.time.desiredFpsMult);
|
|
248
|
-
|
|
249
|
-
this.updateRender(this.time.slowMotion * this.time.desiredFps);
|
|
248
|
+
this.renderer.render(this.stage);
|
|
250
249
|
this.isKickStart = false;
|
|
251
250
|
return;
|
|
252
251
|
}
|
|
253
252
|
if (!this.config.forceSingleUpdate && this._spiraling > 1) {
|
|
254
|
-
// cause an event to warn the program that this CPU can't keep up with the current desiredFps rate
|
|
255
253
|
if (this.time.time > this._nextFpsNotification) {
|
|
256
|
-
// only permit one fps notification per 10 seconds
|
|
257
254
|
this._nextFpsNotification = this.time.time + 10000;
|
|
258
|
-
// dispatch the notification signal
|
|
259
255
|
this.fpsProblemNotifier.dispatch();
|
|
260
256
|
}
|
|
261
|
-
// reset the _deltaTime accumulator which will cause all pending dropped frames to be permanently skipped
|
|
262
257
|
this._deltaTime = 0;
|
|
263
258
|
this._spiraling = 0;
|
|
264
|
-
|
|
265
|
-
this.updateRender(this.time.slowMotion * this.time.desiredFps);
|
|
259
|
+
this.renderer.render(this.stage);
|
|
266
260
|
} else {
|
|
267
|
-
// step size taking into account the slow motion speed
|
|
268
261
|
const slowStep = this.time.slowMotion * 1000.0 / this.time.desiredFps;
|
|
269
|
-
// accumulate time until the slowStep threshold is met or exceeded... up to a limit of 3 catch-up frames at slowStep intervals
|
|
270
262
|
this._deltaTime += Math.max(Math.min(slowStep * 3, this.time.elapsed), 0);
|
|
271
|
-
// call the game update logic multiple times if necessary to "catch up" with dropped frames
|
|
272
|
-
// unless forceSingleUpdate is true
|
|
273
263
|
let count = 0;
|
|
274
264
|
this.updatesThisFrame = Math.floor(this._deltaTime / slowStep);
|
|
275
265
|
if (this.config.forceSingleUpdate) {
|
|
@@ -286,16 +276,13 @@ export default class {
|
|
|
286
276
|
this.time.refresh();
|
|
287
277
|
}
|
|
288
278
|
}
|
|
289
|
-
// detect spiraling (if the catch-up loop isn't fast enough, the number of iterations will increase constantly)
|
|
290
279
|
if (count > this._lastCount) {
|
|
291
280
|
this._spiraling += 1;
|
|
292
281
|
} else if (count < this._lastCount) {
|
|
293
|
-
// looks like it caught up successfully, reset the spiral alert counter
|
|
294
282
|
this._spiraling = 0;
|
|
295
283
|
}
|
|
296
284
|
this._lastCount = count;
|
|
297
|
-
|
|
298
|
-
this.updateRender(this._deltaTime / slowStep);
|
|
285
|
+
this.renderer.render(this.stage);
|
|
299
286
|
}
|
|
300
287
|
}
|
|
301
288
|
|
|
@@ -318,12 +305,6 @@ export default class {
|
|
|
318
305
|
this.stage.updateTransform();
|
|
319
306
|
}
|
|
320
307
|
|
|
321
|
-
updateRender(elapsedTime) {
|
|
322
|
-
this.state.preRender(elapsedTime);
|
|
323
|
-
this.renderer.render(this.stage);
|
|
324
|
-
this.state.render(elapsedTime);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
308
|
destroy() {
|
|
328
309
|
this.isPaused = true;
|
|
329
310
|
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
import Signal from './signal';
|
|
7
7
|
import Rectangle from '../geom/rectangle';
|
|
8
8
|
import { canPlayAudio } from './device_util';
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
const TEXTURE_ATLAS_JSON_HASH = 1;
|
|
10
11
|
|
|
11
12
|
export default class {
|
|
12
13
|
|
|
@@ -687,7 +688,6 @@ export default class {
|
|
|
687
688
|
if (file.atlasURL == null) {
|
|
688
689
|
this.cache.addTextureAtlas(file.key, file.url, file.data, file.atlasData, file.format);
|
|
689
690
|
} else {
|
|
690
|
-
// Load the JSON or XML before carrying on with the next file
|
|
691
691
|
loadNext = false;
|
|
692
692
|
if (file.format === TEXTURE_ATLAS_JSON_HASH) {
|
|
693
693
|
this.xhrLoad(file, this.transformUrl(file.atlasURL, file), 'text', this.jsonLoadComplete);
|
package/src/phaser/core/scene.js
CHANGED
|
@@ -18,14 +18,6 @@ export default class {
|
|
|
18
18
|
// inherit
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
loadUpdate() {
|
|
22
|
-
// inherit
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
loadRender() {
|
|
26
|
-
// inherit
|
|
27
|
-
}
|
|
28
|
-
|
|
29
21
|
create() {
|
|
30
22
|
// inherit
|
|
31
23
|
}
|
|
@@ -34,26 +26,10 @@ export default class {
|
|
|
34
26
|
// inherit
|
|
35
27
|
}
|
|
36
28
|
|
|
37
|
-
preRender() {
|
|
38
|
-
// inherit
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
render() {
|
|
42
|
-
// inherit
|
|
43
|
-
}
|
|
44
|
-
|
|
45
29
|
resize() {
|
|
46
30
|
// inherit
|
|
47
31
|
}
|
|
48
32
|
|
|
49
|
-
paused() {
|
|
50
|
-
// inherit
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
resumed() {
|
|
54
|
-
// inherit
|
|
55
|
-
}
|
|
56
|
-
|
|
57
33
|
pauseUpdate() {
|
|
58
34
|
// inherit
|
|
59
35
|
}
|
|
@@ -24,13 +24,7 @@ export default class {
|
|
|
24
24
|
this.onPreloadCallback = null;
|
|
25
25
|
this.onCreateCallback = null;
|
|
26
26
|
this.onUpdateCallback = null;
|
|
27
|
-
this.onRenderCallback = null;
|
|
28
27
|
this.onResizeCallback = null;
|
|
29
|
-
this.onPreRenderCallback = null;
|
|
30
|
-
this.onLoadUpdateCallback = null;
|
|
31
|
-
this.onLoadRenderCallback = null;
|
|
32
|
-
this.onPausedCallback = null;
|
|
33
|
-
this.onResumedCallback = null;
|
|
34
28
|
this.onPauseUpdateCallback = null;
|
|
35
29
|
this.onShutDownCallback = null;
|
|
36
30
|
}
|
|
@@ -68,15 +62,9 @@ export default class {
|
|
|
68
62
|
this.onInitCallback = null;
|
|
69
63
|
this.onShutDownCallback = null;
|
|
70
64
|
this.onPreloadCallback = null;
|
|
71
|
-
this.onLoadRenderCallback = null;
|
|
72
|
-
this.onLoadUpdateCallback = null;
|
|
73
65
|
this.onCreateCallback = null;
|
|
74
66
|
this.onUpdateCallback = null;
|
|
75
|
-
this.onPreRenderCallback = null;
|
|
76
|
-
this.onRenderCallback = null;
|
|
77
67
|
this.onResizeCallback = null;
|
|
78
|
-
this.onPausedCallback = null;
|
|
79
|
-
this.onResumedCallback = null;
|
|
80
68
|
this.onPauseUpdateCallback = null;
|
|
81
69
|
}
|
|
82
70
|
delete this.states[key];
|
|
@@ -179,15 +167,9 @@ export default class {
|
|
|
179
167
|
// Used when the state is set as being the current active state
|
|
180
168
|
this.onInitCallback = this.callbackContext.init || this.dummy;
|
|
181
169
|
this.onPreloadCallback = this.callbackContext.preload || null;
|
|
182
|
-
this.onLoadRenderCallback = this.callbackContext.loadRender || null;
|
|
183
|
-
this.onLoadUpdateCallback = this.callbackContext.loadUpdate || null;
|
|
184
170
|
this.onCreateCallback = this.callbackContext.create || null;
|
|
185
171
|
this.onUpdateCallback = this.callbackContext.update || null;
|
|
186
|
-
this.onPreRenderCallback = this.callbackContext.preRender || null;
|
|
187
|
-
this.onRenderCallback = this.callbackContext.render || null;
|
|
188
172
|
this.onResizeCallback = this.callbackContext.resize || null;
|
|
189
|
-
this.onPausedCallback = this.callbackContext.paused || null;
|
|
190
|
-
this.onResumedCallback = this.callbackContext.resumed || null;
|
|
191
173
|
this.onPauseUpdateCallback = this.callbackContext.pauseUpdate || null;
|
|
192
174
|
this.onShutDownCallback = this.callbackContext.shutdown || this.dummy;
|
|
193
175
|
this.current = key;
|
|
@@ -204,9 +186,6 @@ export default class {
|
|
|
204
186
|
}
|
|
205
187
|
|
|
206
188
|
loadComplete() {
|
|
207
|
-
if (this._created === false && this.onLoadUpdateCallback) {
|
|
208
|
-
this.onLoadUpdateCallback.call(this.callbackContext, this.game);
|
|
209
|
-
}
|
|
210
189
|
if (this._created === false && this.onCreateCallback) {
|
|
211
190
|
this._created = true;
|
|
212
191
|
this.onCreateCallback.call(this.callbackContext, this.game);
|
|
@@ -215,41 +194,15 @@ export default class {
|
|
|
215
194
|
}
|
|
216
195
|
}
|
|
217
196
|
|
|
218
|
-
pause() {
|
|
219
|
-
if (this._created && this.onPausedCallback) {
|
|
220
|
-
this.onPausedCallback.call(this.callbackContext, this.game);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
resume() {
|
|
225
|
-
if (this._created && this.onResumedCallback) {
|
|
226
|
-
this.onResumedCallback.call(this.callbackContext, this.game);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
197
|
update() {
|
|
231
|
-
if (this._created) {
|
|
232
|
-
|
|
233
|
-
this.onUpdateCallback.call(this.callbackContext, this.game);
|
|
234
|
-
}
|
|
235
|
-
} else if (this.onLoadUpdateCallback) {
|
|
236
|
-
this.onLoadUpdateCallback.call(this.callbackContext, this.game);
|
|
198
|
+
if (this._created && this.onUpdateCallback) {
|
|
199
|
+
this.onUpdateCallback.call(this.callbackContext, this.game);
|
|
237
200
|
}
|
|
238
201
|
}
|
|
239
202
|
|
|
240
203
|
pauseUpdate() {
|
|
241
|
-
if (this._created) {
|
|
242
|
-
|
|
243
|
-
this.onPauseUpdateCallback.call(this.callbackContext, this.game);
|
|
244
|
-
}
|
|
245
|
-
} else if (this.onLoadUpdateCallback) {
|
|
246
|
-
this.onLoadUpdateCallback.call(this.callbackContext, this.game);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
preRender(elapsedTime) {
|
|
251
|
-
if (this._created && this.onPreRenderCallback) {
|
|
252
|
-
this.onPreRenderCallback.call(this.callbackContext, this.game, elapsedTime);
|
|
204
|
+
if (this._created && this.onPauseUpdateCallback) {
|
|
205
|
+
this.onPauseUpdateCallback.call(this.callbackContext, this.game);
|
|
253
206
|
}
|
|
254
207
|
}
|
|
255
208
|
|
|
@@ -259,23 +212,6 @@ export default class {
|
|
|
259
212
|
}
|
|
260
213
|
}
|
|
261
214
|
|
|
262
|
-
render() {
|
|
263
|
-
if (this._created) {
|
|
264
|
-
if (this.onRenderCallback) {
|
|
265
|
-
if (this.game.renderer.type === RENDER_CANVAS) {
|
|
266
|
-
this.game.context.save();
|
|
267
|
-
this.game.context.setTransform(1, 0, 0, 1, 0, 0);
|
|
268
|
-
this.onRenderCallback.call(this.callbackContext, this.game);
|
|
269
|
-
this.game.context.restore();
|
|
270
|
-
} else {
|
|
271
|
-
this.onRenderCallback.call(this.callbackContext, this.game);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
} else if (this.onLoadRenderCallback) {
|
|
275
|
-
this.onLoadRenderCallback.call(this.callbackContext, this.game);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
215
|
destroy() {
|
|
280
216
|
this._clearWorld = true;
|
|
281
217
|
this._clearCache = true;
|
|
@@ -284,13 +220,8 @@ export default class {
|
|
|
284
220
|
this.onInitCallback = null;
|
|
285
221
|
this.onShutDownCallback = null;
|
|
286
222
|
this.onPreloadCallback = null;
|
|
287
|
-
this.onLoadRenderCallback = null;
|
|
288
|
-
this.onLoadUpdateCallback = null;
|
|
289
223
|
this.onCreateCallback = null;
|
|
290
224
|
this.onUpdateCallback = null;
|
|
291
|
-
this.onRenderCallback = null;
|
|
292
|
-
this.onPausedCallback = null;
|
|
293
|
-
this.onResumedCallback = null;
|
|
294
225
|
this.onPauseUpdateCallback = null;
|
|
295
226
|
this.game = null;
|
|
296
227
|
this.states = {};
|
package/src/phaser/core/time.js
CHANGED
|
@@ -14,8 +14,6 @@ export default class {
|
|
|
14
14
|
this.now = 0;
|
|
15
15
|
this.elapsed = 0;
|
|
16
16
|
this.elapsedMS = 0;
|
|
17
|
-
this.physicsElapsed = 1 / 60;
|
|
18
|
-
this.physicsElapsedMS = (1 / 60) * 1000;
|
|
19
17
|
this.desiredFpsMult = 1.0 / 60;
|
|
20
18
|
this._desiredFps = 60;
|
|
21
19
|
this.suggestedFps = this.desiredFps;
|
|
@@ -185,10 +183,6 @@ export default class {
|
|
|
185
183
|
|
|
186
184
|
set desiredFps(value) {
|
|
187
185
|
this._desiredFps = value;
|
|
188
|
-
// Set the physics elapsed time... this will always be 1 / this.desiredFps
|
|
189
|
-
// because we're using fixed time steps in game.update
|
|
190
|
-
this.physicsElapsed = 1 / value;
|
|
191
|
-
this.physicsElapsedMS = this.physicsElapsed * 1000;
|
|
192
186
|
this.desiredFpsMult = 1.0 / value;
|
|
193
187
|
}
|
|
194
188
|
|
package/src/phaser/core/tween.js
CHANGED
|
@@ -129,7 +129,7 @@ export default class {
|
|
|
129
129
|
// Is Running, but is waiting to repeat
|
|
130
130
|
return TWEEN_RUNNING;
|
|
131
131
|
}
|
|
132
|
-
const ms =
|
|
132
|
+
const ms = this.game.time.elapsedMS;
|
|
133
133
|
if (this.parent.reverse) {
|
|
134
134
|
this.dt -= ms * this.parent.timeScale;
|
|
135
135
|
this.dt = Math.max(this.dt, 0);
|