This commit is contained in:
OfficialCHenry 2022-04-23 17:24:46 -04:00
commit 6f66b9666c

View File

@ -123,6 +123,7 @@ export default class GameLevel extends Scene {
pauseText: Label;
pauseInput: TextInput;
pauseSubmit: Label;
pauseCheatText: Label;
protected randomSeed: number;
protected rmg: RandomMapGenerator;
@ -513,7 +514,7 @@ export default class GameLevel extends Scene {
this.healthLabel.textColor = Color.GREEN;
this.healthLabel.font = "PixelSimple";
this.healthLabel.fontSize = 25;
this.healthBar = <Rect>this.add.graphic(GraphicType.RECT, "UI", {position: new Vec2(100+150, 20), size: new Vec2(400, 10)});
this.healthBar = <Rect>this.add.graphic(GraphicType.RECT, "UI", {position: new Vec2(0, 0), size: new Vec2(0, 0)});
this.healthBar.borderColor = Color.BLACK;
this.healthBar.borderWidth = 3;
this.healthBar.color = Color.GREEN;
@ -534,7 +535,7 @@ export default class GameLevel extends Scene {
this.shieldLabel.textColor = Color.ORANGE;
this.shieldLabel.font = "PixelSimple";
this.shieldLabel.fontSize = 25;
this.shieldBar = <Rect>this.add.graphic(GraphicType.RECT, "UI", {position: new Vec2(100+150, 50), size: new Vec2(400, 10)});
this.shieldBar = <Rect>this.add.graphic(GraphicType.RECT, "UI", {position: new Vec2(0, 0), size: new Vec2(0, 0)});
this.shieldBar.borderColor = Color.BLACK;
this.shieldBar.borderWidth = 3;
this.shieldBar.color = Color.ORANGE;
@ -624,6 +625,10 @@ export default class GameLevel extends Scene {
*/
this.add.sprite("black", "pause");
this.add.sprite("black", "story");
this.add.sprite("black", "buffLayer");
//TODO -
//determine button location
this.buffButton1 = <Button>this.add.uiElement(UIElementType.BUTTON, "buffLayer", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x*2/3-180/2), Math.floor(this.viewport.getHalfSize().y)),text:""});
@ -664,19 +669,21 @@ export default class GameLevel extends Scene {
this.buffLayer.disable();
this.pauseText = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x), Math.floor(this.viewport.getHalfSize().y - 50)), text: "Game Paused"});
this.pauseInput = <TextInput>this.add.uiElement(UIElementType.TEXT_INPUT, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x), Math.floor(this.viewport.getHalfSize().y)), text: ""});
this.pauseSubmit = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x), Math.floor(this.viewport.getHalfSize().y + 50)), text: "Submit"});
this.pauseText = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x - 120), Math.floor(this.viewport.getHalfSize().y - 100)), text: ""});
this.pauseInput = <TextInput>this.add.uiElement(UIElementType.TEXT_INPUT, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x - 20), Math.floor(this.viewport.getHalfSize().y + 100)), text: ""});
this.pauseCheatText = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x - 120), Math.floor(this.viewport.getHalfSize().y + 80)), text: "⬇Cheat Code⬇"});
this.pauseSubmit = <Label>this.add.uiElement(UIElementType.LABEL, "pause", {position: new Vec2(Math.floor(this.viewport.getHalfSize().x + 120), Math.floor(this.viewport.getHalfSize().y + 100)), text: "Submit"});
this.add.sprite("black", "pause");
this.add.sprite("black", "story");
this.add.sprite("black", "buffLayer");
this.pauseLayer.setAlpha(0.5);
this.pauseInput.size.set(500, 30);
this.pauseText.textColor = Color.BLACK;
this.pauseText.borderColor = Color.BLACK;
this.pauseText.backgroundColor = Color.WHITE;
this.pauseText.borderWidth = 3;
this.pauseText.textColor = Color.WHITE;
this.pauseText.setHAlign(HAlign.LEFT);
this.pauseText.size = new Vec2(0, 40);
this.pauseText.text = "HP:\nATK:\nDamage Ratio:\nBuff1:\nBuff2:\nBuff3:\nBuff4:\nBuff5:\nBuff6:\nEnemy Killed:\n"
this.pauseCheatText.textColor = Color.WHITE;
this.pauseCheatText.size = new Vec2(0, 40);
this.pauseCheatText.setHAlign(HAlign.LEFT);
this.pauseInput.size.set(400, 30);
this.pauseSubmit.textColor = Color.BLACK;
this.pauseSubmit.borderColor = Color.BLACK;
this.pauseSubmit.backgroundColor = Color.WHITE;
@ -1034,7 +1041,7 @@ export default class GameLevel extends Scene {
this.currentSpeaker = this.story.texts[0].speaker;
this.currentContent = this.story.texts[0].content;
this.storyLayer.enable();
this.storytextLabel = <Label>this.add.uiElement(UIElementType.LABEL, "story", { position: new Vec2(50, 280), text: "" });
this.storytextLabel = <Label>this.add.uiElement(UIElementType.LABEL, "story", { position: new Vec2(50, this.viewport.getHalfSize().y + 80), text: "" });
this.storytextLabel.size = new Vec2(0, 25);
this.storytextLabel.textColor = Color.WHITE;
this.storytextLabel.font = "PixelSimple";
@ -1129,12 +1136,12 @@ export default class GameLevel extends Scene {
enableCheat() {
if (this.pauseInput.text.toUpperCase() === "UUDDLRLRBABA") {
(<PlayerController>this.player._ai).godMode = true;
return;
}
else {
let commands = this.pauseInput.text.split(' ');
console.log(commands);
if (commands.length === 3) {
if (commands[0].toUpperCase() !== "SET") {
if (commands[0].toUpperCase() === "SET") {
switch (commands[1].toUpperCase()) {
case "ATK":
(<PlayerController>this.player._ai).CURRENT_ATK = parseInt(commands[2]);
@ -1154,9 +1161,9 @@ export default class GameLevel extends Scene {
}
}
(<PlayerController>this.player._ai).godMode = false;
}
this.pauseInput.text = "";
}
}