Skip to content

Commit

Permalink
fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Dec 18, 2024
1 parent a93fec5 commit c7b0519
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 95 deletions.
38 changes: 18 additions & 20 deletions src/scenarios/boneIsles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,25 @@ export default async function runScenario(game: Game) {
const world = game.world;
const { worldWidth, worldHeight } = game.viewport;

const terrain = BitmapTerrain.create(
worldWidth,
worldHeight,
game.world,
Assets.get("boneIsles"),
);
const terrain = BitmapTerrain.create(game.world, Assets.get("boneIsles"));

const gameState = new GameState([
{
name: "The Dummys",
group: TeamGroup.Blue,
worms: [
{
name: "Test Dolby",
maxHealth: 100,
health: 100,
},
],
playerUserId: null,
},
]);
const gameState = new GameState(
[
{
name: "The Dummys",
group: TeamGroup.Blue,
worms: [
{
name: "Test Dolby",
maxHealth: 100,
health: 100,
},
],
playerUserId: null,
},
],
world,
);

new GameStateOverlay(
game.pixiApp.ticker,
Expand Down
7 changes: 1 addition & 6 deletions src/scenarios/borealisTribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ export default async function runScenario(game: Game) {
const world = game.world;
const { worldWidth, worldHeight } = game.viewport;

const terrain = BitmapTerrain.create(
worldWidth,
worldHeight,
world,
Assets.get("island1"),
);
const terrain = BitmapTerrain.create(world, Assets.get("island1"));

const bg = await world.addEntity(
Background.create(
Expand Down
92 changes: 45 additions & 47 deletions src/scenarios/grenadeIsland.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,54 +22,52 @@ export default async function runScenario(game: Game) {
const world = game.world;
const { worldWidth, worldHeight } = game.viewport;

const terrain = BitmapTerrain.create(
worldWidth,
worldHeight,
game.world,
Assets.get("terrain2"),
);
const terrain = BitmapTerrain.create(game.world, Assets.get("terrain2"));

const gameState = new GameState([
{
name: "The Dummys",
group: TeamGroup.Blue,
worms: [
{
name: "Test Dolby",
maxHealth: 100,
health: 100,
},
{
name: "Yeen #2",
maxHealth: 100,
health: 100,
},
{
name: "Accident prone",
maxHealth: 100,
health: 100,
},
],
playerUserId: null,
},
{
name: "The Invisible Duo",
group: TeamGroup.Red,
worms: [
{
name: "Egg face",
maxHealth: 100,
health: 100,
},
{
name: "Cream Guy",
maxHealth: 100,
health: 100,
},
],
playerUserId: null,
},
]);
const gameState = new GameState(
[
{
name: "The Dummys",
group: TeamGroup.Blue,
worms: [
{
name: "Test Dolby",
maxHealth: 100,
health: 100,
},
{
name: "Yeen #2",
maxHealth: 100,
health: 100,
},
{
name: "Accident prone",
maxHealth: 100,
health: 100,
},
],
playerUserId: null,
},
{
name: "The Invisible Duo",
group: TeamGroup.Red,
worms: [
{
name: "Egg face",
maxHealth: 100,
health: 100,
},
{
name: "Cream Guy",
maxHealth: 100,
health: 100,
},
],
playerUserId: null,
},
],
world,
);

new GameStateOverlay(
game.pixiApp.ticker,
Expand Down
8 changes: 2 additions & 6 deletions src/scenarios/netGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ export default async function runScenario(game: Game) {
const world = game.world;
const { worldWidth, worldHeight } = game.viewport;

const terrain = BitmapTerrain.create(
worldWidth,
worldHeight,
game.world,
Assets.get("testingGround"),
);
const terrain = BitmapTerrain.create(game.world, Assets.get("testingGround"));

const gameState = new GameState(
[
Expand Down Expand Up @@ -61,6 +56,7 @@ export default async function runScenario(game: Game) {
playerUserId: null,
},
],
world,
{
winWhenOneGroupRemains: true,
},
Expand Down
13 changes: 4 additions & 9 deletions src/scenarios/replayTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ export default async function runScenario(game: Game) {
const world = game.world;
const { worldWidth, worldHeight } = game.viewport;

const terrain = BitmapTerrain.create(
worldWidth,
worldHeight,
game.world,
Assets.get("testingGround"),
);
const terrain = BitmapTerrain.create(game.world, Assets.get("testingGround"));

const player = new TextStateReplay(replayData);
player.on("started", () => {
Expand All @@ -40,7 +35,7 @@ export default async function runScenario(game: Game) {

const initialData = await dataPromise;

const gameState = new GameState(initialData.gameState.teams, {
const gameState = new GameState(initialData.gameState.teams, world, {
// TODO: Rules.
winWhenOneGroupRemains: true,
});
Expand Down Expand Up @@ -169,11 +164,11 @@ export default async function runScenario(game: Game) {
const existingEnt = world.entities.get(ent.uuid);
if (!existingEnt) {
throw new Error(
`Ent ${ent.uuid} ${EntityType[ent.type]} was not found during entity sync`,
`Ent ${ent.uuid} ${ent.type} was not found during entity sync`,
);
} else if (existingEnt instanceof PhysicsEntity === false) {
throw new Error(
`Ent ${ent.uuid} ${EntityType[ent.type]} was unexpectedly not a PhysicsEntity`,
`Ent ${ent.uuid} ${ent.type} was unexpectedly not a PhysicsEntity`,
);
}
existingEnt.loadState(ent);
Expand Down
10 changes: 3 additions & 7 deletions src/scenarios/testingGround.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ export default async function runScenario(game: Game) {
const world = game.world;
const { worldWidth, worldHeight } = game.viewport;

const terrain = BitmapTerrain.create(
worldWidth,
worldHeight,
game.world,
Assets.get("testingGround"),
);
const terrain = BitmapTerrain.create(game.world, Assets.get("testingGround"));

const gameState = new GameState(
[
Expand Down Expand Up @@ -74,6 +69,7 @@ export default async function runScenario(game: Game) {
playerUserId: null,
},
],
world,
{
winWhenOneGroupRemains: true,
},
Expand Down Expand Up @@ -111,7 +107,6 @@ export default async function runScenario(game: Game) {
game.viewport.screenWidth,
game.viewport.screenHeight,
);
const camera = new ViewportCamera(game.viewport, world);

const water = world.addEntity(
new Water(
Expand All @@ -121,6 +116,7 @@ export default async function runScenario(game: Game) {
),
);
water.addToWorld(parent, world);
const camera = new ViewportCamera(game.viewport, world, water.waterHeight);

const wormInstances = new Map<string, Worm>();

Expand Down

0 comments on commit c7b0519

Please sign in to comment.