Skip to content

Commit

Permalink
Fix levels to use new ships
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Hebert committed Jan 1, 2023
1 parent 9580231 commit 5cd6b55
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 222 deletions.
4 changes: 4 additions & 0 deletions fresh-eyed-thoughts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Everything feels fast. Should everything move slower?
- Weapon upgrades/messages get missed. Reduce number of messages? Make things more obvious?
- Should there be some loss of inertia/friction/decelleration?
- It would be easier to improve levels if their file names matched their names, where possible
18 changes: 0 additions & 18 deletions scripts/actions/add-random-ship.js

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/levels/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { Boom } from "../weapons/boom.js";
import { updateWeapons } from "../hud/update-weapons.js";
import { showShieldBar } from "../hud/update-shield-bar.js";
import { random } from "../math/random.js";
import { MiningOverseer } from "../ships/mining-overseer.js";
import { FalconShip } from "../ships/falcon.js";
import { MiningOverseer } from "../ships/archetypes/transport/mining-overseer.js";
import { FalconShip } from "../ships/archetypes/gunship/falcon.js";
import { Commander } from "../ships/archetypes/commander/commander.js";
import { Pew } from "../weapons/pew.js";
import { StasisLaser } from "../weapons/stasis-laser.js";
Expand Down
2 changes: 1 addition & 1 deletion scripts/levels/level3.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
positionToMapBottom,
} from "../math/position-to-map-edge.js";
import { Transport } from "../ships/archetypes/transport/transport.js";
import { MiningOverseer } from "../ships/mining-overseer.js";
import { MiningOverseer } from "../ships/archetypes/transport/mining-overseer.js";
import { battleObjective } from "./objectives/battle.js";

export function level3() {
Expand Down
13 changes: 8 additions & 5 deletions scripts/levels/level4.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { addMessageToQueue } from "../hud/messaging.js";
import { SparrowShip } from "../ships/sparrow.js";
import { mapData } from "../state/map-data.js";
import { ScoutShip } from "../ships/archetypes/scout/scout.js";
import { HunterShip } from "../ships/archetypes/hunter/hunter.js";
import { BigShip } from "../ships/big.js";
import { completeLevel } from "./levels.js";
import {
positionToMapBottom,
Expand All @@ -12,10 +10,15 @@ import {
positionToMapTop,
} from "../math/position-to-map-edge.js";
import { battleObjective } from "./objectives/battle.js";
import { ArtilleryShip } from "../ships/archetypes/artillery/artillery.js";
import { SmallFighterShip } from "../ships/archetypes/small-fighter/small-fighter.js";

export function level4() {
for (let i = 0; i < 3; i++) {
mapData.ships.push(new SparrowShip(positionToMapBottom()));
for (let i = 0; i < 5; i++) {
mapData.ships.push(new SmallFighterShip(positionToMapBottom()));
}
for (let i = 0; i < 5; i++) {
mapData.ships.push(new SmallFighterShip(positionToMapTop()));
}

for (let i = 0; i < 10; i++) {
Expand All @@ -24,7 +27,7 @@ export function level4() {

mapData.ships.push(new HunterShip(positionToMapTop()));

mapData.ships.push(new BigShip(positionToMapRight()));
mapData.ships.push(new ArtilleryShip(positionToMapRight()));

addMessageToQueue({
content: `
Expand Down
11 changes: 4 additions & 7 deletions scripts/levels/level5.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { addMessageToQueue } from "../hud/messaging.js";
import { SparrowShip } from "../ships/sparrow.js";
import { mapData } from "../state/map-data.js";
import { ScoutShip } from "../ships/archetypes/scout/scout.js";
import { HunterShip } from "../ships/archetypes/hunter/hunter.js";
import { BigShip } from "../ships/big.js";
import { completeLevel } from "./levels.js";
import {
positionToMapBottom,
Expand All @@ -12,9 +8,10 @@ import {
positionToMapTop,
} from "../math/position-to-map-edge.js";
import { Transport } from "../ships/archetypes/transport/transport.js";
import { MiningOverseer } from "../ships/mining-overseer.js";
import { MiningOverseer } from "../ships/archetypes/transport/mining-overseer.js";
import { battleObjective } from "./objectives/battle.js";
import { FalconShip } from "../ships/falcon.js";
import { FalconShip } from "../ships/archetypes/gunship/falcon.js";
import { Commander } from "../ships/archetypes/commander/commander.js";

export function level5() {
for (let i = 0; i < 2; i++) {
Expand All @@ -23,7 +20,7 @@ export function level5() {
}

mapData.ships.push(new FalconShip(positionToMapTop()));
mapData.ships.push(new FalconShip(positionToMapBottom()));
mapData.ships.push(new Commander(positionToMapBottom()));

addMessageToQueue({
content: `
Expand Down
140 changes: 70 additions & 70 deletions scripts/levels/levels.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,76 +60,76 @@ export function completeLevel() {
}

export const levels = [
// {
// title: "Company Mining Colony",
// action: tutorial,
// },
// {
// title: "Out of the Frying Pan",
// action: level1,
// },
// {
// title: "Into the Fire",
// action: () => {
// fightLevel({ difficulty: 10 });
// },
// },
// {
// title: "Caught by the Destroyer",
// action: theDestroyer,
// },
// {
// title: "Outside New Sol X",
// action: () => {
// fightLevel({ difficulty: 12 });
// },
// },
// {
// title: "Ambushed By Company Drones",
// action: level4,
// },
// {
// title: "Company Resupply Depot",
// action: () => {
// fightLevel({ difficulty: 16 });
// },
// },
// {
// title: "Company Logistics HQ",
// action: level3,
// },
// {
// title: "The Edge of the Belt",
// action: () => {
// fightLevel({ difficulty: 25 });
// },
// },
// {
// title: "The Big Empty",
// action: level1,
// },
// {
// title: "In Hot Pursuit",
// action: () => {
// fightLevel({ difficulty: 50 });
// },
// },
// {
// title: "Almost Home",
// action: level5,
// },
// {
// title: "The Final Battle",
// action: () => {
// fightLevel({ difficulty: 75 });
// },
// },
// {
// title: "The Overseer",
// action: theOverseer,
// },
{
title: "Secret Debug Level",
action: debugLevel,
title: "Company Mining Colony",
action: tutorial,
},
{
title: "Out of the Frying Pan",
action: level1,
},
{
title: "Into the Fire",
action: () => {
fightLevel({ difficulty: 10 });
},
},
{
title: "Caught by the Destroyer",
action: theDestroyer,
},
{
title: "Outside New Sol X",
action: () => {
fightLevel({ difficulty: 12 });
},
},
{
title: "Ambushed By Company Drones",
action: level4,
},
{
title: "Company Resupply Depot",
action: () => {
fightLevel({ difficulty: 16 });
},
},
{
title: "Company Logistics HQ",
action: level3,
},
{
title: "The Edge of the Belt",
action: () => {
fightLevel({ difficulty: 25 });
},
},
{
title: "The Big Empty",
action: level1,
},
{
title: "In Hot Pursuit",
action: () => {
fightLevel({ difficulty: 50 });
},
},
{
title: "Almost Home",
action: level5,
},
{
title: "The Final Battle",
action: () => {
fightLevel({ difficulty: 75 });
},
},
{
title: "The Overseer",
action: theOverseer,
},
// {
// title: "Secret Debug Level",
// action: debugLevel,
// },
];
22 changes: 14 additions & 8 deletions scripts/levels/types/fight.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
import { Transport } from "../../ships/archetypes/transport/transport.js";
import { HunterShip } from "../../ships/archetypes/hunter/hunter.js";
import { CrowShip } from "../../ships/crow.js";
import { ScoutShip } from "../../ships/archetypes/scout/scout.js";
import { BigShip } from "../../ships/big.js";
import { SparrowShip } from "../../ships/sparrow.js";
import { randomItemInArray, shuffle } from "../../math/random.js";
import { mapData } from "../../state/map-data.js";
import { positionToRandomMapEdge } from "../../math/position-to-map-edge.js";
import { addMessageToQueue } from "../../hud/messaging.js";
import { completeLevel } from "../levels.js";
import { PestShip } from "../../ships/archetypes/pest/pest.js";
import { battleObjective } from "../objectives/battle.js";
import { SprayerShip } from "../../ships/sprayer.js";
import { FalconShip } from "../../ships/falcon.js";
import { FalconShip } from "../../ships/archetypes/gunship/falcon.js";
import { ArmedTransport } from "../../ships/archetypes/armed-transport/armed-transport.js";
import { ArtilleryShip } from "../../ships/archetypes/artillery/artillery.js";
import { Commander } from "../../ships/archetypes/commander/commander.js";
import { GunShip } from "../../ships/archetypes/gunship/gunship.js";
import { SmallFighterShip } from "../../ships/archetypes/small-fighter/small-fighter.js";
import { SpaceStation } from "../../ships/archetypes/space-station/space-station.js";

// TODO: Clusters of enemies
const enemyOptions = [
{
difficulty: 20,
options: [FalconShip],
options: [FalconShip, Commander],
},
{
difficulty: 15,
options: [ArmedTransport, ArtilleryShip, GunShip],
},
{
difficulty: 10,
options: [Transport, HunterShip],
options: [Transport, HunterShip, SpaceStation],
},
{
difficulty: 4,
options: [SprayerShip, SparrowShip, CrowShip],
options: [SmallFighterShip],
},
{
difficulty: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { StasisLaser } from "../weapons/stasis-laser.js";
import { Laser } from "../weapons/laser.js";
import { Pew } from "../weapons/pew.js";
import { Boom } from "../weapons/boom.js";
import { GunShip } from "./archetypes/gunship/gunship.js";
import { StasisLaser } from "../../../weapons/stasis-laser.js";
import { Laser } from "../../../weapons/laser.js";
import { Pew } from "../../../weapons/pew.js";
import { Boom } from "../../../weapons/boom.js";
import { GunShip } from "./gunship.js";

export class FalconShip extends GunShip {
size = 150;
Expand Down
19 changes: 19 additions & 0 deletions scripts/ships/archetypes/small-fighter/sprayer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { SprayBlaster } from "../../../weapons/spray-blaster.js";

export class SmallFighterShip extends SmallFighterShip {
rotationSpeed = 5;
accelerationSpeed = 1;
maxSpeed = 10;
graphic = document.getElementById("ship-3");

size = 150;

maxHealth = 450;
health = 450;

weapons = [new SprayBlaster()];

targetRange = {
min: 0,
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DroneSpawner } from "../weapons/drone-spawner.js";
import { Transport } from "./archetypes/transport/transport.js";
import { DroneSpawner } from "../../../weapons/drone-spawner.js";
import { Transport } from "./transport.js";

export class MiningOverseer extends Transport {
graphic = document.getElementById("ship-2");
Expand Down
23 changes: 0 additions & 23 deletions scripts/ships/big.js

This file was deleted.

15 changes: 0 additions & 15 deletions scripts/ships/crow.js

This file was deleted.

Loading

0 comments on commit 5cd6b55

Please sign in to comment.