feat: add start level and make it the first level
This commit is contained in:
parent
5da79c3bf0
commit
123688a467
|
@ -28,7 +28,7 @@
|
|||
"sprites": [
|
||||
{
|
||||
"type": "player",
|
||||
"x": 1,
|
||||
"x": 3,
|
||||
"y": 13
|
||||
}
|
||||
]
|
||||
|
|
|
@ -269,8 +269,6 @@ export default class Levels extends Scene {
|
|||
if(event.type === "back"){
|
||||
this.sceneManager.changeToScene(MainMenu, {});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import GameLevel from "./GameLevel";
|
|||
import InputWrapper from "../Tools/InputWrapper";
|
||||
import TextInput from "../../Wolfie2D/Nodes/UIElements/TextInput";
|
||||
import Forest from "./Forest";
|
||||
import Start from "./Start";
|
||||
|
||||
export default class MainMenu extends Scene {
|
||||
protected config: ConfigManager;
|
||||
|
@ -194,7 +195,7 @@ export default class MainMenu extends Scene {
|
|||
]
|
||||
}
|
||||
}
|
||||
this.sceneManager.changeToScene(Forest, {}, sceneOptions);
|
||||
this.sceneManager.changeToScene(Start, {}, sceneOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,11 @@ export default class Start extends GameLevel {
|
|||
//load enemies
|
||||
}
|
||||
|
||||
startScene(): void {
|
||||
super.startScene();
|
||||
this.addCheckPoint(new Vec2(3, 13), new Vec2(10, 10), "endStory", "nextLevel");
|
||||
}
|
||||
|
||||
protected goToNextLevel(): void {
|
||||
this.viewport.setZoomLevel(1);
|
||||
let sceneOptions = {
|
||||
|
@ -30,14 +35,6 @@ export default class Start extends GameLevel {
|
|||
this.sceneManager.changeToScene(Forest, {}, sceneOptions);
|
||||
}
|
||||
|
||||
protected playStartStory(): void {
|
||||
if (!this.touchedStartCheckPoint) {
|
||||
this.touchedStartCheckPoint = true;
|
||||
this.storyLoader("shattered_sword_assets/jsons/level1story.json");
|
||||
this.startTimer();
|
||||
}
|
||||
}
|
||||
|
||||
protected playEndStory() {
|
||||
if (!this.touchedEndCheckPoint) {
|
||||
this.touchedEndCheckPoint = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user