Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - upgrade to latest phaser #14

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/environment/tileset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions assets/map.tmx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" tiledversion="1.1.5" orientation="orthogonal" renderorder="right-down" width="40" height="40" tilewidth="16" tileheight="16" infinite="0" nextobjectid="16">
<tileset firstgid="1" name="tileset" tilewidth="16" tileheight="16" tilecount="1088" columns="34">
<image source="environment/tileset.png" width="544" height="512"/>
<map version="1.2" tiledversion="1.3.4" orientation="orthogonal" renderorder="right-down" width="40" height="40" tilewidth="16" tileheight="16" infinite="0" nextlayerid="7" nextobjectid="16">
<tileset firstgid="1" name="tileset" tilewidth="16" tileheight="16" spacing="2" margin="1" tilecount="1368" columns="34">
<image source="environment/tileset.png" width="612" height="576"/>
<terraintypes>
<terrain name="water" tile="123"/>
<terrain name="mountain" tile="83"/>
Expand Down Expand Up @@ -5449,7 +5449,7 @@
</properties>
</tile>
</tileset>
<layer name="terrain" width="40" height="40">
<layer id="1" name="terrain" width="40" height="40">
<data encoding="csv">
487,487,492,458,242,311,626,185,186,187,626,626,626,626,626,156,124,124,124,67,166,66,67,135,91,157,166,66,166,168,157,167,169,67,135,159,132,157,168,91,
487,487,487,492,458,459,626,185,186,187,626,626,626,626,626,88,124,124,124,99,193,193,193,193,193,191,191,193,191,193,193,193,100,101,64,166,67,132,167,91,
Expand Down Expand Up @@ -5493,7 +5493,7 @@
626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,626,479,483,378,73,485,174,186,242,390,378,186,458,118,481,480,77,481,492
</data>
</layer>
<layer name="bridge" width="40" height="40">
<layer id="2" name="bridge" width="40" height="40">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Expand Down Expand Up @@ -5537,7 +5537,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer name="deco" width="40" height="40">
<layer id="3" name="deco" width="40" height="40">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,543,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
Expand Down Expand Up @@ -5581,7 +5581,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,492,0,0,0,0,483,483,0,0,0,0,0,0,0,0
</data>
</layer>
<objectgroup name="monsters">
<objectgroup id="4" name="monsters">
<object id="1" name="treant" x="499.279" y="174.332">
<point/>
</object>
Expand All @@ -5592,7 +5592,7 @@
<point/>
</object>
</objectgroup>
<objectgroup name="npcs">
<objectgroup id="5" name="npcs">
<object id="6" name="npc" x="58.2323" y="146.777">
<properties>
<property name="message" value="Hello! Watch out for the dangerous treants!"/>
Expand All @@ -5606,7 +5606,7 @@
<point/>
</object>
</objectgroup>
<objectgroup name="zones">
<objectgroup id="6" name="zones">
<object id="11" x="355.775" y="408.424" width="13.5609" height="44.6713">
<properties>
<property name="comesBackFrom" value="right"/>
Expand Down
17,328 changes: 8,935 additions & 8,393 deletions assets/tilemap.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"clean-webpack-plugin": "3.0.0",
"gh-pages": "2.1.1",
"html-webpack-plugin": "^3.2.0",
"phaser": "3.10.1"
"phaser": "3.23.0"
},
"devDependencies": {
"@types/jest": "24.0.18",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class PhaserGame extends Phaser.Game {
pixelArt: true,
physics: {
default: 'arcade',
// arcade: {
// debug: true,
// },
arcade: {
debug: true,
},
},
scene: [Preloader, FirstLevel, SecondLevel, GameManager, HUD],
};
Expand Down
4 changes: 2 additions & 2 deletions src/scenes/AbstractScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface InterSceneData {

export abstract class AbstractScene extends Phaser.Scene {
public player: Player;
public cursors: CursorKeys;
public cursors: Phaser.Types.Input.Keyboard.CursorKeys;
public npcs: Npc[];
public monsters: Monster[];
public map: Phaser.Tilemaps.Tilemap;
Expand Down Expand Up @@ -114,7 +114,7 @@ export abstract class AbstractScene extends Phaser.Scene {

private createMapWithLayers() {
this.map = this.make.tilemap({ key: this.mapKey });
const tileset = this.map.addTilesetImage(ASSETS.TILESET, ASSETS.IMAGES.TILES, 16, 16, 0, 0);
const tileset = this.map.addTilesetImage(ASSETS.TILESET, ASSETS.IMAGES.TILES, 16, 16, 1, 2);

this.layers = {
terrain: this.map.createStaticLayer(MAP_CONTENT_KEYS.layers.BACKGROUND, tileset, 0, 0),
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"outDir": "./built",
"allowJs": true,
"moduleResolution": "node",
"target": "ES6",
"lib": ["es2017", "dom"],
"noUnusedParameters": true,
Expand All @@ -15,7 +16,7 @@
"require": true
}
},
"files": ["typings/typings.d.ts", "typings/phaser.d.ts"],
"files": ["typings/typings.d.ts"],
"include": ["./src/**/*"],
"exclude": ["node_modules", "bin"]
}
Loading