feat: added end level
This commit is contained in:
parent
5502255b7e
commit
52c9dc1299
|
@ -29,7 +29,7 @@
|
||||||
{
|
{
|
||||||
"type": "player",
|
"type": "player",
|
||||||
"x": 3,
|
"x": 3,
|
||||||
"y": 13
|
"y": 12.5
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,6 +3,7 @@ import RandomMapGenerator from "../Tools/RandomMapGenerator";
|
||||||
import GameLevel from "./GameLevel";
|
import GameLevel from "./GameLevel";
|
||||||
import InputWrapper from "../Tools/InputWrapper";
|
import InputWrapper from "../Tools/InputWrapper";
|
||||||
import Forest from "./Forest";
|
import Forest from "./Forest";
|
||||||
|
import GameFinish from "./GameFinish";
|
||||||
|
|
||||||
export default class End extends GameLevel {
|
export default class End extends GameLevel {
|
||||||
loadScene(): void {
|
loadScene(): void {
|
||||||
|
@ -14,40 +15,21 @@ export default class End extends GameLevel {
|
||||||
//load enemies
|
//load enemies
|
||||||
}
|
}
|
||||||
|
|
||||||
updateScene(deltaT: number): void {
|
startScene(): void {
|
||||||
super.updateScene(deltaT);
|
super.startScene();
|
||||||
|
this.addCheckPoint(new Vec2(3, 13), new Vec2(10, 10), "startStory", "nextLevel");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected goToNextLevel(): void {
|
protected goToNextLevel(): void {
|
||||||
this.viewport.setZoomLevel(1);
|
this.viewport.setZoomLevel(1);
|
||||||
let sceneOptions = {
|
this.sceneManager.changeToScene(GameFinish);
|
||||||
physics: {
|
|
||||||
groupNames: ["ground", "player", "enemies"],
|
|
||||||
collisions:
|
|
||||||
[
|
|
||||||
[0, 1, 1],
|
|
||||||
[1, 0, 0],
|
|
||||||
[1, 0, 0]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.sceneManager.changeToScene(Forest, {}, sceneOptions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected playStartStory(): void {
|
protected playStartStory(): void {
|
||||||
if (!this.touchedStartCheckPoint) {
|
if (!this.touchedStartCheckPoint) {
|
||||||
this.touchedStartCheckPoint = true;
|
this.touchedStartCheckPoint = true;
|
||||||
this.storyLoader("shattered_sword_assetsshattered_sword_assets/jsons/level1story.json");
|
this.storyLoader("shattered_sword_assets/jsons/level1story.json");
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected playEndStory() {
|
|
||||||
if (!this.touchedEndCheckPoint) {
|
|
||||||
this.touchedEndCheckPoint = true;
|
|
||||||
this.storyLoader("shattered_sword_assets/jsons/story.json");
|
|
||||||
this.endTimer();
|
|
||||||
this.levelEnded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -395,6 +395,7 @@ export default class GameLevel extends Scene {
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
break;
|
break;
|
||||||
case "nextLevel":
|
case "nextLevel":
|
||||||
|
this.endTimer();
|
||||||
this.goToNextLevel();
|
this.goToNextLevel();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import AABB from "../../Wolfie2D/DataTypes/Shapes/AABB";
|
||||||
import EnemyAI from "../AI/EnemyAI";
|
import EnemyAI from "../AI/EnemyAI";
|
||||||
import BattlerAI from "../AI/BattlerAI";
|
import BattlerAI from "../AI/BattlerAI";
|
||||||
import InputWrapper from "../Tools/InputWrapper";
|
import InputWrapper from "../Tools/InputWrapper";
|
||||||
|
import End from "./End";
|
||||||
|
|
||||||
export default class Market extends GameLevel {
|
export default class Market extends GameLevel {
|
||||||
loadScene(): void {
|
loadScene(): void {
|
||||||
|
@ -42,7 +43,7 @@ export default class Market extends GameLevel {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.sceneManager.changeToScene(Market, {}, sceneOptions);
|
this.sceneManager.changeToScene(End, {}, sceneOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected playStartStory(): void {
|
protected playStartStory(): void {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user