Add egg logic and hatching screen (WiP) and end biome arena BG
This commit is contained in:
1 parent
f4ad9546c0
commit
71fdafe8fb
31 files changed
+2204
-15
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import BattleScene, { Button } from "../battle-scene";
|
||||
import { Mode } from "./ui";
|
||||
import UiHandler from "./uiHandler";
|
||||
|
||||
export default class EggHatchSceneHandler extends UiHandler {
|
||||
public eggHatchContainer: Phaser.GameObjects.Container;
|
||||
|
||||
constructor(scene: BattleScene) {
|
||||
super(scene, Mode.EGG_HATCH_SCENE);
|
||||
}
|
||||
|
||||
setup() {
|
||||
this.eggHatchContainer = this.scene.add.container(0, -this.scene.game.canvas.height / 6);
|
||||
this.scene.fieldUI.add(this.eggHatchContainer);
|
||||
|
||||
const eggLightraysAnimFrames = this.scene.anims.generateFrameNames('egg_lightrays', { start: 0, end: 3 });
|
||||
this.scene.anims.create({
|
||||
key: 'egg_lightrays',
|
||||
frames: eggLightraysAnimFrames,
|
||||
frameRate: 32
|
||||
});
|
||||
}
|
||||
|
||||
show(_args: any[]): void {
|
||||
super.show(_args);
|
||||
|
||||
this.scene.fieldUI.bringToTop(this.eggHatchContainer);
|
||||
}
|
||||
|
||||
processInput(button: Button): boolean {
|
||||
return this.scene.ui.getMessageHandler().processInput(button);
|
||||
}
|
||||
|
||||
setCursor(_cursor: integer): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.eggHatchContainer.removeAll(true);
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,6 @@ export default class EvolutionSceneHandler extends UiHandler {
|
||||
public canCancel: boolean;
|
||||
public cancelled: boolean;
|
||||
|
||||
private cleanupFunc: Function;
|
||||
|
||||
constructor(scene: BattleScene) {
|
||||
super(scene, Mode.EVOLUTION_SCENE);
|
||||
}
|
||||
|
||||
+5
-1
@@ -20,6 +20,7 @@ import AchvBar from './achv-bar';
|
||||
import MenuUiHandler from './menu-ui-handler';
|
||||
import AchvsUiHandler from './achvs-ui-handler';
|
||||
import OptionSelectUiHandler from './option-select-ui-handler';
|
||||
import EggHatchSceneHandler from './egg-hatch-scene-handler';
|
||||
|
||||
export enum Mode {
|
||||
MESSAGE,
|
||||
@@ -33,6 +34,7 @@ export enum Mode {
|
||||
BIOME_SELECT,
|
||||
STARTER_SELECT,
|
||||
EVOLUTION_SCENE,
|
||||
EGG_HATCH_SCENE,
|
||||
CONFIRM,
|
||||
OPTION_SELECT,
|
||||
GAME_MODE_SELECT,
|
||||
@@ -45,7 +47,8 @@ const transitionModes = [
|
||||
Mode.PARTY,
|
||||
Mode.SUMMARY,
|
||||
Mode.STARTER_SELECT,
|
||||
Mode.EVOLUTION_SCENE
|
||||
Mode.EVOLUTION_SCENE,
|
||||
Mode.EGG_HATCH_SCENE
|
||||
];
|
||||
|
||||
const noTransitionModes = [
|
||||
@@ -87,6 +90,7 @@ export default class UI extends Phaser.GameObjects.Container {
|
||||
new BiomeSelectUiHandler(scene),
|
||||
new StarterSelectUiHandler(scene),
|
||||
new EvolutionSceneHandler(scene),
|
||||
new EggHatchSceneHandler(scene),
|
||||
new ConfirmUiHandler(scene),
|
||||
new OptionSelectUiHandler(scene),
|
||||
new GameModeSelectUiHandler(scene),
|
||||
|
||||
Reference in new issue
Block a user