Merge branch 'master' of https://github.com/kellypeng44/ShatteredSword
This commit is contained in:
commit
6f66b9666c
|
@ -123,6 +123,7 @@ export default class GameLevel extends Scene {
|
||||||
pauseText: Label;
|
pauseText: Label;
|
||||||
pauseInput: TextInput;
|
pauseInput: TextInput;
|
||||||
pauseSubmit: Label;
|
pauseSubmit: Label;
|
||||||
|
pauseCheatText: Label;
|
||||||
|
|
||||||
protected randomSeed: number;
|
protected randomSeed: number;
|
||||||
protected rmg: RandomMapGenerator;
|
protected rmg: RandomMapGenerator;
|
||||||
|
@ -513,7 +514,7 @@ export default class GameLevel extends Scene {
|
||||||
this.healthLabel.textColor = Color.GREEN;
|
this.healthLabel.textColor = Color.GREEN;
|
||||||
this.healthLabel.font = "PixelSimple";
|
this.healthLabel.font = "PixelSimple";
|
||||||
this.healthLabel.fontSize = 25;
|
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.borderColor = Color.BLACK;
|
||||||
this.healthBar.borderWidth = 3;
|
this.healthBar.borderWidth = 3;
|
||||||
this.healthBar.color = Color.GREEN;
|
this.healthBar.color = Color.GREEN;
|
||||||
|
@ -534,7 +535,7 @@ export default class GameLevel extends Scene {
|
||||||
this.shieldLabel.textColor = Color.ORANGE;
|
this.shieldLabel.textColor = Color.ORANGE;
|
||||||
this.shieldLabel.font = "PixelSimple";
|
this.shieldLabel.font = "PixelSimple";
|
||||||
this.shieldLabel.fontSize = 25;
|
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.borderColor = Color.BLACK;
|
||||||
this.shieldBar.borderWidth = 3;
|
this.shieldBar.borderWidth = 3;
|
||||||
this.shieldBar.color = Color.ORANGE;
|
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 -
|
//TODO -
|
||||||
//determine button location
|
//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:""});
|
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.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.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), Math.floor(this.viewport.getHalfSize().y)), 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.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.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.pauseLayer.setAlpha(0.5);
|
||||||
this.pauseInput.size.set(500, 30);
|
this.pauseText.textColor = Color.WHITE;
|
||||||
this.pauseText.textColor = Color.BLACK;
|
this.pauseText.setHAlign(HAlign.LEFT);
|
||||||
this.pauseText.borderColor = Color.BLACK;
|
this.pauseText.size = new Vec2(0, 40);
|
||||||
this.pauseText.backgroundColor = Color.WHITE;
|
this.pauseText.text = "HP:\nATK:\nDamage Ratio:\nBuff1:\nBuff2:\nBuff3:\nBuff4:\nBuff5:\nBuff6:\nEnemy Killed:\n"
|
||||||
this.pauseText.borderWidth = 3;
|
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.textColor = Color.BLACK;
|
||||||
this.pauseSubmit.borderColor = Color.BLACK;
|
this.pauseSubmit.borderColor = Color.BLACK;
|
||||||
this.pauseSubmit.backgroundColor = Color.WHITE;
|
this.pauseSubmit.backgroundColor = Color.WHITE;
|
||||||
|
@ -1034,7 +1041,7 @@ export default class GameLevel extends Scene {
|
||||||
this.currentSpeaker = this.story.texts[0].speaker;
|
this.currentSpeaker = this.story.texts[0].speaker;
|
||||||
this.currentContent = this.story.texts[0].content;
|
this.currentContent = this.story.texts[0].content;
|
||||||
this.storyLayer.enable();
|
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.size = new Vec2(0, 25);
|
||||||
this.storytextLabel.textColor = Color.WHITE;
|
this.storytextLabel.textColor = Color.WHITE;
|
||||||
this.storytextLabel.font = "PixelSimple";
|
this.storytextLabel.font = "PixelSimple";
|
||||||
|
@ -1129,12 +1136,12 @@ export default class GameLevel extends Scene {
|
||||||
enableCheat() {
|
enableCheat() {
|
||||||
if (this.pauseInput.text.toUpperCase() === "UUDDLRLRBABA") {
|
if (this.pauseInput.text.toUpperCase() === "UUDDLRLRBABA") {
|
||||||
(<PlayerController>this.player._ai).godMode = true;
|
(<PlayerController>this.player._ai).godMode = true;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let commands = this.pauseInput.text.split(' ');
|
let commands = this.pauseInput.text.split(' ');
|
||||||
|
console.log(commands);
|
||||||
if (commands.length === 3) {
|
if (commands.length === 3) {
|
||||||
if (commands[0].toUpperCase() !== "SET") {
|
if (commands[0].toUpperCase() === "SET") {
|
||||||
switch (commands[1].toUpperCase()) {
|
switch (commands[1].toUpperCase()) {
|
||||||
case "ATK":
|
case "ATK":
|
||||||
(<PlayerController>this.player._ai).CURRENT_ATK = parseInt(commands[2]);
|
(<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;
|
(<PlayerController>this.player._ai).godMode = false;
|
||||||
|
}
|
||||||
|
this.pauseInput.text = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user