@vpmedia/phaser 1.1.2 → 1.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  @vpmedia/phaser
2
2
  ===============
3
3
 
4
- [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.1.2)](https://badge.fury.io/js/@vpmedia%2Fphaser)
4
+ [![npm version](https://badge.fury.io/js/@vpmedia%2Fphaser.svg?v=1.1.4)](https://badge.fury.io/js/@vpmedia%2Fphaser)
5
5
  [![Node.js CI](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml/badge.svg)](https://github.com/vpmedia/phaser/actions/workflows/node.js.yml)
6
6
 
7
7
  @vpmedia/phaser is the modern ECMAScript port of the popular Phaser game engine v2.6.2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/phaser",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
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",
@@ -17,12 +17,6 @@
17
17
  ],
18
18
  "main": "./src/index.js",
19
19
  "devDependencies": {
20
- "@babel/cli": "^7.19.3",
21
- "@babel/core": "^7.20.5",
22
- "@babel/eslint-parser": "^7.19.1",
23
- "@babel/preset-env": "^7.20.2",
24
- "@babel/register": "^7.18.9",
25
- "babel-loader": "^8.3.0",
26
20
  "eslint": "^8.29.0",
27
21
  "eslint-config-prettier": "^8.5.0",
28
22
  "eslint-plugin-import": "^2.26.0",
@@ -32,19 +26,14 @@
32
26
  "husky": "^8.0.2",
33
27
  "jest": "^29.3.1",
34
28
  "lint-staged": "^13.1.0",
35
- "prettier": "^2.8.0",
36
- "webpack": "^5.75.0",
37
- "webpack-cli": "^4.10.0"
29
+ "prettier": "^2.8.0"
38
30
  },
39
31
  "scripts": {
40
- "prebuild": "rm -rf ./dist && mkdir -p ./dist",
41
- "build": "webpack --config webpack.config.babel.js --mode production",
42
- "test": "jest --passWithNoTests",
32
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests",
43
33
  "lint": "eslint \"**/*.js\"",
44
34
  "lint-fix": "eslint \"**/*.js\" --fix",
45
35
  "format": "prettier --write \"**/*.{js,json}\"",
46
- "lint-staged": "lint-staged",
47
- "prepack": "npm run build"
36
+ "lint-staged": "lint-staged"
48
37
  },
49
38
  "engines": {
50
39
  "npm": ">=7.0.0",
@@ -31,9 +31,6 @@ export default class {
31
31
  this.m4a = false;
32
32
  this.webm = false;
33
33
  this.dolby = false;
34
- this.iPhone = false;
35
- this.iPad = false;
36
- this.pixelRatio = 1;
37
34
  this.fullscreen = false;
38
35
  this.requestFullscreen = '';
39
36
  this.cancelFullscreen = '';
@@ -191,16 +191,6 @@ export function checkAudio(device) {
191
191
  }
192
192
  }
193
193
 
194
- /**
195
- *
196
- * @param {object} device TBD
197
- */
198
- export function checkDevice(device) {
199
- device.pixelRatio = window.devicePixelRatio || 1;
200
- device.iPhone = navigator.userAgent.toLowerCase().indexOf('iphone') !== -1;
201
- device.iPad = navigator.userAgent.toLowerCase().indexOf('ipad') !== -1;
202
- }
203
-
204
194
  /**
205
195
  *
206
196
  * @param {object} device TBD
@@ -209,7 +199,6 @@ export function initialize(device) {
209
199
  checkOS(device);
210
200
  checkBrowser(device);
211
201
  checkAudio(device);
212
- checkDevice(device);
213
202
  checkFullScreenSupport(device);
214
203
  checkInput(device);
215
204
  }
@@ -170,36 +170,20 @@ export default class {
170
170
  }
171
171
 
172
172
  parseConfig(config) {
173
- /* game */
174
173
  this.parseConfigElement(config, 'width', 800);
175
174
  this.parseConfigElement(config, 'height', 600);
176
175
  this.parseConfigElement(config, 'backgroundColor', 0x000000);
177
- // Should the game loop force a logic update, regardless of the delta timer? Set to true if you know you need this. You can toggle it on the fly.
178
- this.parseConfigElement(config, 'forceSingleUpdate', true);
179
- /* canvas */
180
176
  this.parseConfigElement(config, 'canvasID', '');
181
177
  this.parseConfigElement(config, 'canvasStyle', undefined);
182
- /* renderer */
183
- // The resolution of your game.
184
178
  this.parseConfigElement(config, 'resolution', 1);
185
- // Use a transparent canvas background or not.
186
- this.parseConfigElement(config, 'transparent', false);
187
- // Anti-alias graphics. By default scaled images are smoothed in Canvas and WebGL, set anti-alias to false to disable this globally.
179
+ this.parseConfigElement(config, 'transparent', true);
188
180
  this.parseConfigElement(config, 'antialias', false);
189
- // The value of the preserveDrawingBuffer flag affects whether or not the contents of the stencil buffer is retained after rendering.
190
181
  this.parseConfigElement(config, 'preserveDrawingBuffer', false);
191
- // Clear the Canvas each frame before rendering the display list.
192
- // You can set this to `false` to gain some performance if your game always contains a background that completely fills the display.
193
182
  this.parseConfigElement(config, 'clearBeforeRender', false);
194
- // The Renderer this game will use. Either Const.RENDER_AUTO, Const.RENDER_CANVAS, Const.RENDER_WEBGL
183
+ this.parseConfigElement(config, 'roundPixels', true);
195
184
  this.parseConfigElement(config, 'renderType', RENDER_AUTO);
196
- // Force audio disabled
197
185
  this.parseConfigElement(config, 'isForceDisabledAudio', false);
198
- // Sets the number of maximum parallel requests for the loaded (in case of HTTP/2 you can raise this)
199
186
  this.parseConfigElement(config, 'maxParallelDownloads', 16);
200
- if (config.renderer) {
201
- this.config.renderType = config.renderer;
202
- }
203
187
  if (config.exceptionHandler) {
204
188
  this.exceptionHandler = config.exceptionHandler;
205
189
  } else {
@@ -32,7 +32,7 @@ export default class {
32
32
  maskManager: CanvasMaskManager,
33
33
  scaleMode: null,
34
34
  smoothProperty: getSmoothingPrefix(this.context),
35
- roundPixels: false,
35
+ roundPixels: game.config.roundPixels,
36
36
  };
37
37
  this.mapBlendModes();
38
38
  this.resize(this.width, this.height);