Initial commit

This commit is contained in:
Peter Stockings
2026-01-04 09:22:55 +11:00
commit 04277726db
19 changed files with 1364 additions and 0 deletions

41
src/scenes/SplashScene.ts Normal file
View File

@@ -0,0 +1,41 @@
import Phaser from "phaser";
import { Scene } from 'phaser';
export class SplashScene extends Scene {
constructor() {
super("SplashScene");
}
preload() {
this.load.image('splash', 'splash_bg.png');
}
create() {
const { width, height } = this.scale;
// Background (Placeholder for Image)
// If we successfully load the image 'splash', we use it.
if (this.textures.exists('splash')) {
this.add.image(width / 2, height / 2, 'splash').setDisplaySize(width, height);
} else {
this.add.rectangle(0, 0, width, height, 0x110022).setOrigin(0);
this.add.text(width/2, height/2, "ROGUE LEGACY", {
fontSize: "48px",
color: "#ffffff",
fontStyle: "bold"
}).setOrigin(0.5);
}
// Fade In
this.cameras.main.fadeIn(1000, 0, 0, 0);
// Fade Out after delay
this.time.delayedCall(2500, () => {
this.cameras.main.fadeOut(1000, 0, 0, 0);
});
this.cameras.main.once(Phaser.Cameras.Scene2D.Events.FADE_OUT_COMPLETE, () => {
this.scene.start("StartScene");
});
}
}