From ab4935403e8b7af3e60749f24bcb72dbf3c6acf6 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 30 Nov 2022 16:04:48 +0100 Subject: [PATCH] rename --- assets/Scripts/Game/Data/GameSettings.ts | 2 +- assets/Scripts/Game/GameBootstrapper.ts | 18 +++++++++--------- ...cher.ts => HorizontalProjectileLauncher.ts} | 2 +- ...ta => HorizontalProjectileLauncher.ts.meta} | 0 assets/Scripts/Game/Upgrades/UpgradeType.ts | 1 - assets/Scripts/Game/Upgrades/Upgrader.ts | 14 +++++++++----- 6 files changed, 20 insertions(+), 17 deletions(-) rename assets/Scripts/Game/Unit/Player/ProjectileLauncher/{VerticalProjectileLauncher.ts => HorizontalProjectileLauncher.ts} (93%) rename assets/Scripts/Game/Unit/Player/ProjectileLauncher/{VerticalProjectileLauncher.ts.meta => HorizontalProjectileLauncher.ts.meta} (100%) diff --git a/assets/Scripts/Game/Data/GameSettings.ts b/assets/Scripts/Game/Data/GameSettings.ts index b796919..3c160c8 100644 --- a/assets/Scripts/Game/Data/GameSettings.ts +++ b/assets/Scripts/Game/Data/GameSettings.ts @@ -41,7 +41,7 @@ export class UpgradeSettings { public maxWeaponLengthUpgrades = 0; public maxWeaponDamageUpgrades = 0; public maxHorizontalProjectileUpgrades = 0; - public maxVerticalProjectileUpgrades = 0; + public maxHorizontalProjectileUpgrades = 0; public maxHaloProjectileUpgrades = 0; public maxRegenerationUpgrades = 0; } diff --git a/assets/Scripts/Game/GameBootstrapper.ts b/assets/Scripts/Game/GameBootstrapper.ts index d462f1c..2349355 100644 --- a/assets/Scripts/Game/GameBootstrapper.ts +++ b/assets/Scripts/Game/GameBootstrapper.ts @@ -14,7 +14,7 @@ import { EnemyManager } from "./Unit/Enemy/EnemyManager"; import { Player } from "./Unit/Player/Player"; import { HaloProjectileLauncher } from "./Unit/Player/ProjectileLauncher/HaloProjectileLauncher"; import { ProjectileLauncher } from "./Unit/Player/ProjectileLauncher/ProjectileLauncher"; -import { VerticalProjectileLauncher } from "./Unit/Player/ProjectileLauncher/VerticalProjectileLauncher"; +import { HorizontalProjectileLauncher } from "./Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher"; import { Upgrader } from "./Upgrades/Upgrader"; const { ccclass, property } = _decorator; @@ -33,7 +33,7 @@ export class GameBootstrapper extends Component { private playerCollisionSystem: PlayerCollisionSystem; private haloProjectileLauncher: HaloProjectileLauncher; - private verticalProjectileLauncher: VerticalProjectileLauncher; + private horizontalProjectileLauncher: HorizontalProjectileLauncher; private gamePauser: Pauser = new Pauser(); @@ -50,9 +50,6 @@ export class GameBootstrapper extends Component { this.playerCollisionSystem = new PlayerCollisionSystem(this.player, settings.player.collisionDelay); new WeaponCollisionSystem(this.player.Weapon); - const upgrader = new Upgrader(this.player, settings.upgrades); - new GameModalLauncher(this.modalWindowManager, this.player, this.gamePauser, upgrader); - this.enemyManager.init(this.player.node); this.haloProjectileLauncher = new HaloProjectileLauncher( @@ -62,14 +59,17 @@ export class GameBootstrapper extends Component { ); this.haloProjectileLauncher.upgrade(); - this.verticalProjectileLauncher = new VerticalProjectileLauncher( + this.horizontalProjectileLauncher = new HorizontalProjectileLauncher( this.verticalProjectileLauncherComponent, this.player.node, settings.player.xyLaunchers ); - this.verticalProjectileLauncher.upgrade(); + this.horizontalProjectileLauncher.upgrade(); - new PlayerProjectileCollisionSystem([this.haloProjectileLauncher, this.verticalProjectileLauncher]); + new PlayerProjectileCollisionSystem([this.haloProjectileLauncher, this.horizontalProjectileLauncher]); + + const upgrader = new Upgrader(this.player, this.horizontalProjectileLauncher, this.haloProjectileLauncher, settings.upgrades); + new GameModalLauncher(this.modalWindowManager, this.player, this.gamePauser, upgrader); this.gameUI.init(this.player); } @@ -81,7 +81,7 @@ export class GameBootstrapper extends Component { this.playerCollisionSystem.gameTick(deltaTime); this.enemyManager.gameTick(deltaTime); this.haloProjectileLauncher.gameTick(deltaTime); - this.verticalProjectileLauncher.gameTick(deltaTime); + this.horizontalProjectileLauncher.gameTick(deltaTime); this.camera.node.worldPosition = this.player.node.worldPosition; } diff --git a/assets/Scripts/Game/Unit/Player/ProjectileLauncher/VerticalProjectileLauncher.ts b/assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts similarity index 93% rename from assets/Scripts/Game/Unit/Player/ProjectileLauncher/VerticalProjectileLauncher.ts rename to assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts index 604fe81..73cbc23 100644 --- a/assets/Scripts/Game/Unit/Player/ProjectileLauncher/VerticalProjectileLauncher.ts +++ b/assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts @@ -5,7 +5,7 @@ import { IProjectileCollisionSignaler } from "../../../Projectile/IProjectileCol import { ProjectileCollision } from "../../../Projectile/ProjectileCollision"; import { ProjectileLauncher } from "./ProjectileLauncher"; -export class VerticalProjectileLauncher implements IProjectileCollisionSignaler { +export class HorizontalProjectileLauncher implements IProjectileCollisionSignaler { private currentUpgrade = 0; private wavesToShootPerUpgrade = 0; diff --git a/assets/Scripts/Game/Unit/Player/ProjectileLauncher/VerticalProjectileLauncher.ts.meta b/assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts.meta similarity index 100% rename from assets/Scripts/Game/Unit/Player/ProjectileLauncher/VerticalProjectileLauncher.ts.meta rename to assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts.meta diff --git a/assets/Scripts/Game/Upgrades/UpgradeType.ts b/assets/Scripts/Game/Upgrades/UpgradeType.ts index 5f106e8..aa3d579 100644 --- a/assets/Scripts/Game/Upgrades/UpgradeType.ts +++ b/assets/Scripts/Game/Upgrades/UpgradeType.ts @@ -2,7 +2,6 @@ export enum UpgradeType { WeaponLength, WeaponDamage, HorizontalProjectile, - VerticalProjectile, HaloProjectlie, Regeneration } diff --git a/assets/Scripts/Game/Upgrades/Upgrader.ts b/assets/Scripts/Game/Upgrades/Upgrader.ts index cc2b6a2..ae1e1b9 100644 --- a/assets/Scripts/Game/Upgrades/Upgrader.ts +++ b/assets/Scripts/Game/Upgrades/Upgrader.ts @@ -1,7 +1,7 @@ import { UpgradeSettings } from "../Data/GameSettings"; import { Player } from "../Unit/Player/Player"; import { HaloProjectileLauncher } from "../Unit/Player/ProjectileLauncher/HaloProjectileLauncher"; -import { VerticalProjectileLauncher } from "../Unit/Player/ProjectileLauncher/VerticalProjectileLauncher"; +import { HorizontalProjectileLauncher } from "../Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher"; import { UpgradeType } from "./UpgradeType"; export class Upgrader { @@ -11,13 +11,17 @@ export class Upgrader { public constructor( private player: Player, - private verticalProjectileLauncher: VerticalProjectileLauncher, + private horizontalProjectileLauncher: HorizontalProjectileLauncher, private haloProjectileLauncher: HaloProjectileLauncher, settings: UpgradeSettings ) { this.setTypeMaps(UpgradeType.WeaponLength, this.upgradeWeaponLength.bind(this), settings.maxWeaponLengthUpgrades); this.setTypeMaps(UpgradeType.WeaponDamage, this.upgradeWeaponDamage.bind(this), settings.maxWeaponDamageUpgrades); - this.setTypeMaps(UpgradeType.VerticalProjectile, this.upgradeVerticalProjectileLauncher.bind(this), settings.maxVerticalProjectileUpgrades); + this.setTypeMaps( + UpgradeType.HorizontalProjectile, + this.upgradeHorizontalProjectileLauncher.bind(this), + settings.maxHorizontalProjectileUpgrades + ); this.setTypeMaps(UpgradeType.HaloProjectlie, this.upgradeHaloProjectileLauncher.bind(this), settings.maxHaloProjectileUpgrades); this.setTypeMaps(UpgradeType.Regeneration, this.upgradeRegeneration.bind(this), settings.maxRegenerationUpgrades); } @@ -56,8 +60,8 @@ export class Upgrader { this.player.Weapon.upgradeWeaponDamage(); } - private upgradeVerticalProjectileLauncher(): void { - this.verticalProjectileLauncher.upgrade(); + private upgradeHorizontalProjectileLauncher(): void { + this.horizontalProjectileLauncher.upgrade(); } private upgradeHaloProjectileLauncher(): void {