diff --git a/src/classes/Assets.ts b/src/classes/Assets.ts index 2eb6350..ff3f944 100644 --- a/src/classes/Assets.ts +++ b/src/classes/Assets.ts @@ -35,6 +35,7 @@ export default class GameAssets { public static PlayIconTexture: PIXI.Texture; public static PauseIconTexture: PIXI.Texture; public static ExclamationIconTexture: PIXI.Texture; + public static FastForwardIconTexture: PIXI.Texture; public static HomeIconTexture: PIXI.Texture; public static HammerIconTexture: PIXI.Texture; public static XIconTexture: PIXI.Texture; @@ -118,7 +119,8 @@ export default class GameAssets { this.Load('./assets/gui/title01.png').then((texture) => (this.TitleTexture = texture)), this.Load('./assets/gui/icons/play.png').then((texture) => (this.PlayIconTexture = texture)), this.Load('./assets/gui/icons/pause.png').then((texture) => (this.PauseIconTexture = texture)), - this.Load('./assets/gui/icons/exclamation.png').then((texture) => (this.ExclamationIconTexture = texture)), + this.Load('./assets/gui/icons/pause.png').then((texture) => (this.PauseIconTexture = texture)), + this.Load('./assets/gui/icons/fastforward.png').then((texture) => (this.FastForwardIconTexture = texture)), this.Load('./assets/gui/icons/home.png').then((texture) => (this.HomeIconTexture = texture)), this.Load('./assets/gui/icons/hammer.png').then((texture) => (this.HammerIconTexture = texture)), this.Load('./assets/gui/icons/cross.png').then((texture) => (this.XIconTexture = texture)), diff --git a/src/scenes/Game.ts b/src/scenes/Game.ts index 6a80ca7..a1997a8 100644 --- a/src/scenes/Game.ts +++ b/src/scenes/Game.ts @@ -37,6 +37,7 @@ export class GameScene extends Scene { public tooltip: Tooltip; public towerPanel: TowerPanel; public isPaused: boolean = false; + private isFastForwarded: boolean = false; private pauseButton: Button; private visualGems: VisualGemSlot[] = []; private currentRound: number = 0; @@ -103,12 +104,20 @@ export class GameScene extends Scene { this.changeRoundButton.CustomButtonLogic(); this.changeRoundButton.onClick = () => { if (this.playerWon) return this.ReturnToMain(); - if (this.roundMode == RoundMode.Combat) - return Engine.NotificationManager.Notify('Wave is already in progress.', 'warn'); + if (this.roundMode == RoundMode.Combat) { + // TODO: figure out how to actually double speed without causing bugs. + if (this.isFastForwarded) { + this.isFastForwarded = false; + Engine.NotificationManager.Notify('Regular speed.', 'info'); + } else { + this.isFastForwarded = true; + Engine.NotificationManager.Notify('Fast forward activated.', 'info'); + } + } if (this.isGameOver) return Engine.NotificationManager.Notify('No more waves.', 'danger'); if (this.roundMode == RoundMode.Misc) return; this.setRoundMode(RoundMode.Combat); - this.changeRoundButton.buttonIcon.texture = GameAssets.ExclamationIconTexture; + this.changeRoundButton.buttonIcon.texture = GameAssets.FastForwardIconTexture; this.events.emit(WaveManagerEvents.NewWave, `${this.currentRound + 1}`); }; this.MissionStats = new MissionStats(125, 450); @@ -156,10 +165,10 @@ export class GameScene extends Scene { this.ticker.add(() => { if (this.update) this.update(this.ticker.elapsedMS); + // if (this.isFastForwarded) this.update(this.ticker.elapsedMS); }); this.ticker.start(); } - public update(elapsedMS) { if (this.isGameOver) { if (this.destroyTicker) {