SpaceRace: Full-width TV field, death line scrolling, camera following leader, jump fix, path never fully blocked, player color on controller

This commit is contained in:
2026-06-24 16:41:37 +02:00
commit 5e2ab43ca3
46 changed files with 6581 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
import { Ship as ShipType, Position, Direction, posEqual } from '@spacerace/shared';
export class Ship {
id: string;
playerId: string;
playerName: string;
position: Position;
direction: Direction;
alive: boolean;
shielded: boolean;
phaseShifting: boolean;
empActive: boolean;
boostSteps: number;
constructor(id: string, playerId: string, playerName: string, position: Position, direction: Direction) {
this.id = id;
this.playerId = playerId;
this.playerName = playerName;
this.position = { ...position };
this.direction = direction;
this.alive = true;
this.shielded = false;
this.phaseShifting = false;
this.empActive = false;
this.boostSteps = 0;
}
resetRoundEffects(): void {
this.shielded = false;
this.phaseShifting = false;
this.empActive = false;
this.boostSteps = 0;
}
toState(): ShipType {
return {
id: this.id,
playerId: this.playerId,
playerName: this.playerName,
position: { ...this.position },
direction: this.direction,
alive: this.alive,
};
}
}