fix
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m29s
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m29s
This commit is contained in:
@@ -5,6 +5,7 @@ import { GameSocket } from "../net/Socket";
|
|||||||
|
|
||||||
let localAddr: string = "ws://localhost:8080/ws";
|
let localAddr: string = "ws://localhost:8080/ws";
|
||||||
let remoteAddr: string = "wss://tma-api.quizer.space/ws";
|
let remoteAddr: string = "wss://tma-api.quizer.space/ws";
|
||||||
|
let isLocal: boolean = true;
|
||||||
|
|
||||||
type ServerPlayerState = {
|
type ServerPlayerState = {
|
||||||
x: number;
|
x: number;
|
||||||
@@ -19,7 +20,7 @@ export class GameScene extends Phaser.Scene {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
this.inputCtrl = new TouchInput(this);
|
this.inputCtrl = new TouchInput(this);
|
||||||
this.socket = new GameSocket(localAddr);
|
this.socket = new GameSocket(isLocal ? localAddr : remoteAddr);
|
||||||
|
|
||||||
this.socket.onState = (state) => {
|
this.socket.onState = (state) => {
|
||||||
this.syncPlayers(state.players);
|
this.syncPlayers(state.players);
|
||||||
|
|||||||
Reference in New Issue
Block a user