Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Commit

Permalink
fix spawn position
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanger committed Mar 6, 2023
1 parent 2585903 commit 677e613
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .idea/workspace.xml

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

7 changes: 3 additions & 4 deletions src/game/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,14 @@ export class Game {
break;
}
} catch(e) {
console.warn("Error parsing message:", e);
//console.warn("Error parsing message:", e);
}
}

addPlayer(socket, username, loadout) {
let spawnPosition;
spawnPosition = Vector.create(450, 150);
//if(GameOptions.debugMode) spawnPosition = Vector.create(450, 150);
//else spawnPosition = Utils.randomVec(75, this.map.width - 75, 75, this.map.height - 75);
if(GameOptions.debugMode) spawnPosition = Vector.create(450, 150);
else spawnPosition = Utils.randomVec(75, this.map.width - 75, 75, this.map.height - 75);

const p = new Player(socket, this, username, spawnPosition, loadout);
p.id = this.map.objects.length;
Expand Down

0 comments on commit 677e613

Please sign in to comment.