@vpmedia/phaser 1.0.39 → 1.0.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
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",
@@ -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 = 1;
15
- export const IMAGE = 2;
16
- export const TEXTURE = 3;
17
- export const SOUND = 4;
18
- export const TEXT = 5;
19
- export const PHYSICS = 6;
20
- export const TILEMAP = 7;
21
- export const BINARY = 8;
22
- export const BITMAPDATA = 9;
23
- export const BITMAPFONT = 10;
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
  }
@@ -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;
@@ -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
- import { TEXTURE_ATLAS_JSON_HASH } from './const';
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);
@@ -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
 
@@ -29,7 +29,6 @@ export default class {
29
29
  this.properties = {};
30
30
  this.chainedTween = null;
31
31
  this.isPaused = false;
32
- this.frameBased = manager.frameBased;
33
32
  this._onUpdateCallback = null;
34
33
  this._onUpdateCallbackContext = null;
35
34
  this._pausedTime = 0;
@@ -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 = (this.parent.frameBased) ? this.game.time.physicsElapsedMS : this.game.time.elapsedMS;
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);
@@ -23,7 +23,6 @@ export default class {
23
23
 
24
24
  constructor(game) {
25
25
  this.game = game;
26
- this.frameBased = false;
27
26
  this._tweens = [];
28
27
  this._add = [];
29
28
  this.easeMap = {