summaryrefslogtreecommitdiff
path: root/client/src/akkamon/scenes/DemoScene.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/akkamon/scenes/DemoScene.ts')
-rw-r--r--client/src/akkamon/scenes/DemoScene.ts33
1 files changed, 1 insertions, 32 deletions
diff --git a/client/src/akkamon/scenes/DemoScene.ts b/client/src/akkamon/scenes/DemoScene.ts
index b9a230a..66da72f 100644
--- a/client/src/akkamon/scenes/DemoScene.ts
+++ b/client/src/akkamon/scenes/DemoScene.ts
@@ -11,38 +11,7 @@ export class DemoScene extends AkkamonWorldScene
create ()
{
- this.map = this.make.tilemap({ key: "map" });
- // Parameters are the name you gave the tileset in Tiled and then the key of the tileset image in
- // Phaser's cache (i.e. the name you used in preload)
- const tileset = this.map.addTilesetImage("akkamon-demo-extruded", "tiles");
- // Parameters: layer name (or index) from Tiled, tileset, x, y
- const belowLayer = this.map.createLayer("Below Player", tileset, 0, 0);
- const worldLayer = this.map.createLayer("World", tileset, 0, 0);
- const aboveLayer = this.map.createLayer("Above Player", tileset, 0, 0);
- // By default, everything gets depth sorted on the screen in the order we created things. Here, we
- // want the "Above Player" layer to sit on top of the player, so we explicitly give it a depth.
- // Higher depths will sit on top of lower depth objects.
- aboveLayer.setDepth(10);
-
- this.spawnPoint = this.map.findObject("Objects", obj => obj.name === "Spawn Point");
-
- var tilePos = new Phaser.Math.Vector2(
- Math.floor(this.spawnPoint.x! / AkkamonWorldScene.TILE_SIZE),
- Math.floor(this.spawnPoint.y! / AkkamonWorldScene.TILE_SIZE),
- );
- this.spawnPointTilePos = tilePos;
-
- this.client.requestInitPlayerSprite(
- this
- );
-
- let akey = this.input.keyboard.addKey('a');
- akey.on('down', () => {
- this.input.keyboard.enabled = false;
- this.eventsCenter.emit('open-menu');
- // this.client.disableGridControls();
- });
-
+ super.create("map", "akkamon-demo-extruded");
}