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

Commit

Permalink
fix: adds ".js" extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixselve committed Jan 30, 2024
1 parent 6f7069b commit 4df6443
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { SOCKET_EVENTS, TPS, PlayerMoveDTO } from "@viper-vortex/shared";
import { Server } from "socket.io";
import { Player } from "./lib/Player.js";
import { Scene } from "./lib/Scene.js";
import { SEND_SCORES_INTERVAL } from "./lib/constants";
import { SEND_SCORES_INTERVAL } from "./lib/constants.js";

const io = new Server({
cors: {
Expand Down
5 changes: 2 additions & 3 deletions packages/server/src/lib/Chunk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CHUNK_SIZE, FOOD_POINTS, FOOD_PER_CHUNK } from "./constants";
import { CHUNK_SIZE, FOOD_POINTS, FOOD_PER_CHUNK } from "./constants.js";
import { Orb } from "./Orb.js";
import { PICKUP_RADIUS, Position } from "@viper-vortex/shared";
import { Player } from "./Player.js";
Expand Down Expand Up @@ -67,8 +67,7 @@ export class Chunk {

public getCollidingPlayersWithPlayer(player: Player): Player[] {
return this.playerArray.filter(
(p) =>
p.id !== player.id && p.isColliding(player.head, PICKUP_RADIUS),
(p) => p.id !== player.id && p.isColliding(player.head, PICKUP_RADIUS),
);
}

Expand Down
10 changes: 5 additions & 5 deletions packages/server/src/lib/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
PLAYER_SPAWN_BODY_PARTS,
RENDER_DISTANCE,
} from "./constants.js";
import { Orb } from "./Orb";
import { Orb } from "./Orb.js";

export class Player {
private isSprinting: boolean = false;
Expand All @@ -40,7 +40,7 @@ export class Player {
constructor(
public readonly socket: Socket,
public name: string,
public readonly position: Position
public readonly position: Position,
) {
this.color = randomDarkColor();
this.body.push({
Expand Down Expand Up @@ -101,7 +101,7 @@ export class Player {
for (let x = -renderDistance; x <= renderDistance; x++) {
for (let y = -renderDistance; y <= renderDistance; y++) {
const chunk = chunks.get(
`${headChunk.topX / CHUNK_SIZE + x},${headChunk.topY / CHUNK_SIZE + y}`
`${headChunk.topX / CHUNK_SIZE + x},${headChunk.topY / CHUNK_SIZE + y}`,
);
if (chunk) {
chunksInView.push(chunk);
Expand Down Expand Up @@ -162,8 +162,8 @@ export class Player {
y: this.tail.y,
},
1,
this.color
)
this.color,
),
);

this.score -= SCORE_PER_LOST_ORB;
Expand Down

0 comments on commit 4df6443

Please sign in to comment.