summaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
Diffstat (limited to 'client/src')
-rw-r--r--client/src/RemotePlayerEngine.ts14
-rw-r--r--client/src/RemotePlayerSprite.ts1
-rw-r--r--client/src/scene.ts11
3 files changed, 22 insertions, 4 deletions
diff --git a/client/src/RemotePlayerEngine.ts b/client/src/RemotePlayerEngine.ts
new file mode 100644
index 0000000..f19ebe0
--- /dev/null
+++ b/client/src/RemotePlayerEngine.ts
@@ -0,0 +1,14 @@
+import Phaser from 'phaser';
+import { akkamonClient } from './app';
+
+export class RemotePlayerEngine {
+
+ private scene: Phaser.Scene
+
+ constructor(scene: Phaser.Scene) {
+ this.scene = scene;
+ }
+
+ update() {
+ }
+}
diff --git a/client/src/RemotePlayerSprite.ts b/client/src/RemotePlayerSprite.ts
new file mode 100644
index 0000000..8485803
--- /dev/null
+++ b/client/src/RemotePlayerSprite.ts
@@ -0,0 +1 @@
+import Phaser from 'phaser';
diff --git a/client/src/scene.ts b/client/src/scene.ts
index 29bf253..52edbdd 100644
--- a/client/src/scene.ts
+++ b/client/src/scene.ts
@@ -1,12 +1,14 @@
import Phaser from 'phaser';
import { akkamonClient } from './app';
-import type { GameState } from './GameState';
import { Player } from './player';
import { PlayerSprite } from './sprite';
+
import { GridControls } from './GridControls';
import { GridPhysics } from './GridPhysics';
import { Direction } from './Direction';
+import { RemotePlayerEngine } from './RemotePlayerEngine';
+
type RemotePlayerStates = {
[name: string]: Player
@@ -17,10 +19,11 @@ export default class AkkamonStartScene extends Phaser.Scene
static readonly TILE_SIZE = 32;
- private akkamonState?: GameState
private gridPhysics?: GridPhysics
private gridControls?: GridControls
+ private remotePlayerEngine?: RemotePlayerEngine
+
directionToAnimation: {
[key in Direction]: string
} = {
@@ -81,8 +84,6 @@ export default class AkkamonStartScene extends Phaser.Scene
// Create a sprite with physics enabled via the physics system. The image used for the sprite has
// a bit of whitespace, so I'm using setSize & setOffset to control the size of the player's body.
- this.akkamonState = akkamonClient.getMutableState();
-
var tilePos = new Phaser.Math.Vector2(
Math.floor(this.spawnPoint.x! / AkkamonStartScene.TILE_SIZE),
Math.floor(this.spawnPoint.y! / AkkamonStartScene.TILE_SIZE),
@@ -106,6 +107,8 @@ export default class AkkamonStartScene extends Phaser.Scene
this.gridPhysics
);
+ this.remotePlayerEngine = new RemotePlayerEngine(this);
+
this.createPlayerAnimation(Direction.LEFT, 0, 3);
this.createPlayerAnimation(Direction.RIGHT, 0, 3);
this.createPlayerAnimation(Direction.UP, 0, 3);