Skip to content

Commit

Permalink
chore(deps): bump phaser from 3.55.2 to 3.60.0 (#306)
Browse files Browse the repository at this point in the history
* chore(deps): bump phaser from 3.55.2 to 3.60.0

Bumps [phaser](https://github.com/photonstorm/phaser) from 3.55.2 to 3.60.0.
- [Release notes](https://github.com/photonstorm/phaser/releases)
- [Changelog](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md)
- [Commits](phaserjs/phaser@v3.55.2...v3.60.0)

---
updated-dependencies:
- dependency-name: phaser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: fix type errors and update .eslintrc.json

```
Found 8 errors in 2 files.

Errors  Files
     7  src/scenes/Main.ts:82
     1  src/sprites/Player.ts:38
```

* build(package): install `process` to fix parcel build

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark <[email protected]>
  • Loading branch information
dependabot[bot] and remarkablemark authored Apr 24, 2023
1 parent 11a325f commit f20b359
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 77 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"plugins": ["@typescript-eslint", "prettier", "simple-import-sort"],
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"no-console": "error",
"no-debugger": "error",
"prettier/prettier": "error",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: npm run lint

- name: Type check
run: npm run tsc
run: npm run lint:tsc

- name: Read package version
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
Expand Down
85 changes: 20 additions & 65 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"clean": "rm -rf .parcel-cache/ dist/",
"lint": "eslint --ignore-path .gitignore .",
"lint:fix": "npm run lint -- --fix",
"lint:tsc": "tsc --noEmit",
"postinstall": "husky install",
"start": "parcel --open",
"tsc": "tsc --noEmit"
"start": "parcel --open"
},
"homepage": "https://remarkablegames.org/inversion/",
"dependencies": {
"phaser": "3.55.2"
"phaser": "3.60.0"
},
"devDependencies": {
"@commitlint/cli": "^17.6.1",
Expand All @@ -32,6 +32,7 @@
"lint-staged": "^13.2.1",
"parcel": "^2.8.3",
"prettier": "^2.8.7",
"process": "^0.11.10",
"standard-version": "^9.5.0",
"typescript": "^5.0.4"
},
Expand Down
17 changes: 10 additions & 7 deletions src/scenes/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export default class Main extends Phaser.Scene {
const tiles = map.addTilesetImage(
'0x72-industrial-tileset-32px-extruded',
key.image.tiles
);
)!;

this.groundLayer = map.createLayer('Ground', tiles);
this.groundLayer = map.createLayer('Ground', tiles)!;
this.spawnPlayers(map);
this.overlapPlayers(this.playerA, this.playerB);

Expand All @@ -105,12 +105,13 @@ export default class Main extends Phaser.Scene {

// The map has spikes rotated in Tiled (z key), so parse out that angle to the correct body placement
spike.rotation = tile.rotation;
const spikeBody = spike.body!;
if (spike.angle === 0) {
spike.body.setSize(32, 6).setOffset(0, 26);
spikeBody.setSize(32, 6).setOffset(0, 26);
} else if (spike.angle === -90) {
spike.body.setSize(6, 32).setOffset(26, 0);
spikeBody.setSize(6, 32).setOffset(26, 0);
} else if (spike.angle === 90) {
spike.body.setSize(6, 32).setOffset(0, 0);
spikeBody.setSize(6, 32).setOffset(0, 0);
}

this.groundLayer.removeTileAt(tile.x, tile.y);
Expand All @@ -137,13 +138,15 @@ export default class Main extends Phaser.Scene {
this.renderLevel(map);
this.renderTitle(map);

const inputKeyboard = this.input.keyboard!;

// invert
['keydown-SPACE', 'keydown-I'].forEach((event) =>
this.input.keyboard.on(event, this.invertPlayers, this)
inputKeyboard.on(event, this.invertPlayers, this)
);

// restart
this.input.keyboard.on('keydown-R', () => {
inputKeyboard.on('keydown-R', () => {
sendEvent('level_start', {
level: this.levelData.level,
restart: 'input',
Expand Down
2 changes: 1 addition & 1 deletion src/sprites/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class Player extends Phaser.Physics.Arcade.Sprite {

// Track the arrow keys & WASD
const { UP, LEFT, RIGHT, W, A, D } = Phaser.Input.Keyboard.KeyCodes;
this.keys = scene.input.keyboard.addKeys({
this.keys = scene.input.keyboard!.addKeys({
up: UP,
left: LEFT,
right: RIGHT,
Expand Down

0 comments on commit f20b359

Please sign in to comment.