added splash screen

This commit is contained in:
OfficialCHenry 2022-04-25 22:14:13 -04:00
parent 036f5a87ba
commit a03c33d07c
2 changed files with 10 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import MainMenu from "./shattered_sword/Scenes/MainMenu";
import RegistryManager from "./Wolfie2D/Registry/RegistryManager"; import RegistryManager from "./Wolfie2D/Registry/RegistryManager";
import WeaponTemplateRegistry from "./shattered_sword/Registry/WeaponRegistry"; import WeaponTemplateRegistry from "./shattered_sword/Registry/WeaponRegistry";
import WeaponTypeRegistry from "./shattered_sword/Registry/WeaponTypeRegistry"; import WeaponTypeRegistry from "./shattered_sword/Registry/WeaponTypeRegistry";
import SplashScreen from "./shattered_sword/Scenes/SplashScreen";
// The main function is your entrypoint into Wolfie2D. Specify your first scene and any options here. // The main function is your entrypoint into Wolfie2D. Specify your first scene and any options here.
(function main(){ (function main(){
// Run any tests // Run any tests
@ -47,7 +47,7 @@ import WeaponTypeRegistry from "./shattered_sword/Registry/WeaponTypeRegistry";
const game = new Game(options); const game = new Game(options);
// Start our game // Start our game
game.start(MainMenu, {}); game.start(SplashScreen, {});
//TODO - change to splash screen once available //TODO - change to splash screen once available
//game.start(SplashScreen,{}); //game.start(SplashScreen,{});
})(); })();

View File

@ -11,9 +11,9 @@ import Layer from "../../Wolfie2D/Scene/Layer";
import Label from "../../Wolfie2D/Nodes/UIElements/Label"; import Label from "../../Wolfie2D/Nodes/UIElements/Label";
import Levels from "./Levels"; import Levels from "./Levels";
import InputWrapper from "../Tools/InputWrapper"; import InputWrapper from "../Tools/InputWrapper";
import MainMenu from "./MainMenu";
export default class SplashScreen extends Scene {
export default class MainMenu extends Scene {
protected config: ConfigManager; protected config: ConfigManager;
protected save: SaveManager; protected save: SaveManager;
@ -22,8 +22,8 @@ export default class MainMenu extends Scene {
loadScene(): void { loadScene(): void {
//load images //load images
//this.load.image("logo", "shattered_sword_assets/images/Shattered_Sword_Logo.png"); this.load.image("logo", "shattered_sword_assets/images/black.png");
//this.load.image("backgroundImage", "shattered_sword_assets/images/Background.png"); this.load.image("backgroundImage", "shattered_sword_assets/images/logo.png");
// Load the menu song // Load the menu song
//this.load.audio("menu", "assets/music/menu.mp3"); //this.load.audio("menu", "assets/music/menu.mp3");
} }
@ -70,6 +70,10 @@ export default class MainMenu extends Scene {
updateScene(){ updateScene(){
if (InputWrapper.isLeftMouseJustPressed()) { //if left click
this.sceneManager.changeToScene(MainMenu, {}, {});
}
while(this.receiver.hasNextEvent()){ while(this.receiver.hasNextEvent()){
let event = this.receiver.getNextEvent(); let event = this.receiver.getNextEvent();
console.log(event); console.log(event);