Skip to content

Commit

Permalink
Merge pull request #89 from biancuercole/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
biancuercole authored Dec 5, 2023
2 parents 4c0751c + d0ea205 commit b2af07b
Show file tree
Hide file tree
Showing 13 changed files with 457 additions and 485 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"D:\\Programación\\Bigotes-de-Acero\\src\\main.js":"1","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Game.js":"2"},{"size":1242,"mtime":1699999598469,"results":"3","hashOfConfig":"4"},{"size":16397,"mtime":1699999318630,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","suppressedMessages":"8","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"xbnu0e",{"filePath":"9","messages":"10","suppressedMessages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":7,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"D:\\Programación\\Bigotes-de-Acero\\src\\main.js",[],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Game.js",["12","13","14","15","16","17","18"],[],{"ruleId":"19","severity":1,"message":"20","line":243,"column":5,"nodeType":"21","messageId":"22","endLine":243,"endColumn":16},{"ruleId":"19","severity":1,"message":"20","line":335,"column":5,"nodeType":"21","messageId":"22","endLine":335,"endColumn":16},{"ruleId":"19","severity":1,"message":"20","line":349,"column":5,"nodeType":"21","messageId":"22","endLine":349,"endColumn":16},{"ruleId":"19","severity":1,"message":"20","line":354,"column":5,"nodeType":"21","messageId":"22","endLine":354,"endColumn":16},{"ruleId":"19","severity":1,"message":"20","line":395,"column":5,"nodeType":"21","messageId":"22","endLine":395,"endColumn":16},{"ruleId":"19","severity":1,"message":"20","line":405,"column":5,"nodeType":"21","messageId":"22","endLine":405,"endColumn":16},{"ruleId":"19","severity":1,"message":"20","line":409,"column":9,"nodeType":"21","messageId":"22","endLine":409,"endColumn":20},"no-console","Unexpected console statement.","MemberExpression","unexpected"]
[{"D:\\Programación\\Bigotes-de-Acero\\src\\main.js":"1","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Game.js":"2","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Language.js":"3","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Login.js":"4","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Menu.js":"5","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Controls.js":"6","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Credits.js":"7","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\GameOver.js":"8","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Pause.js":"9","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Preload.js":"10","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\UI.js":"11","D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Victory.js":"12"},{"size":1242,"mtime":1699999598469,"results":"13","hashOfConfig":"14"},{"size":16172,"mtime":1701387578351,"results":"15","hashOfConfig":"14"},{"size":3081,"mtime":1701378291065,"results":"16","hashOfConfig":"14"},{"size":2775,"mtime":1701379332268,"results":"17","hashOfConfig":"14"},{"size":3746,"mtime":1701379292942},{"size":1146,"mtime":1701388212811,"results":"18","hashOfConfig":"14"},{"size":2475,"mtime":1701388396831,"results":"19","hashOfConfig":"14"},{"size":2886,"mtime":1701387788789,"results":"20","hashOfConfig":"14"},{"size":2439,"mtime":1701388396828,"results":"21","hashOfConfig":"14"},{"size":10139,"mtime":1701388393102,"results":"22","hashOfConfig":"14"},{"size":2299,"mtime":1701388030399,"results":"23","hashOfConfig":"14"},{"size":2769,"mtime":1701738170455,"results":"24","hashOfConfig":"14"},{"filePath":"25","messages":"26","suppressedMessages":"27","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"xbnu0e",{"filePath":"28","messages":"29","suppressedMessages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":7,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"D:\\Programación\\Bigotes-de-Acero\\src\\main.js",[],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Game.js",["58","59","60","61","62","63","64"],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Language.js",[],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Login.js",[],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Controls.js",[],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Credits.js",[],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\GameOver.js",["65","66"],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Pause.js",["67","68","69"],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Preload.js",[],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\UI.js",["70"],[],"D:\\Programación\\Bigotes-de-Acero\\src\\scenes\\Victory.js",["71"],[],{"ruleId":"72","severity":1,"message":"73","line":243,"column":5,"nodeType":"74","messageId":"75","endLine":243,"endColumn":16},{"ruleId":"72","severity":1,"message":"73","line":335,"column":5,"nodeType":"74","messageId":"75","endLine":335,"endColumn":16},{"ruleId":"72","severity":1,"message":"73","line":349,"column":5,"nodeType":"74","messageId":"75","endLine":349,"endColumn":16},{"ruleId":"72","severity":1,"message":"73","line":354,"column":5,"nodeType":"74","messageId":"75","endLine":354,"endColumn":16},{"ruleId":"72","severity":1,"message":"73","line":395,"column":5,"nodeType":"74","messageId":"75","endLine":395,"endColumn":16},{"ruleId":"72","severity":1,"message":"73","line":405,"column":5,"nodeType":"74","messageId":"75","endLine":405,"endColumn":16},{"ruleId":"72","severity":1,"message":"73","line":409,"column":9,"nodeType":"74","messageId":"75","endLine":409,"endColumn":20},{"ruleId":"72","severity":1,"message":"73","line":55,"column":7,"nodeType":"74","messageId":"75","endLine":55,"endColumn":18},{"ruleId":"72","severity":1,"message":"73","line":71,"column":7,"nodeType":"74","messageId":"75","endLine":71,"endColumn":18},{"ruleId":"72","severity":1,"message":"73","line":33,"column":13,"nodeType":"74","messageId":"75","endLine":33,"endColumn":24},{"ruleId":"72","severity":1,"message":"73","line":45,"column":13,"nodeType":"74","messageId":"75","endLine":45,"endColumn":24},{"ruleId":"72","severity":1,"message":"73","line":60,"column":13,"nodeType":"74","messageId":"75","endLine":60,"endColumn":24},{"ruleId":"72","severity":1,"message":"73","line":66,"column":5,"nodeType":"74","messageId":"75","endLine":66,"endColumn":16},{"ruleId":"72","severity":1,"message":"73","line":56,"column":7,"nodeType":"74","messageId":"75","endLine":56,"endColumn":18},"no-console","Unexpected console statement.","MemberExpression","unexpected"]
3 changes: 0 additions & 3 deletions src/components/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ export default class Player extends Phaser.GameObjects.Sprite {

scene.add.existing(this);
scene.physics.add.existing(this);

// this.body.setSize(105, 60);
// this.body.setOffset(16, 35);

this.body.setCollideWorldBounds(true);
this.body.setGravityY(450)
Expand Down
64 changes: 30 additions & 34 deletions src/scenes/Controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,37 @@ export default class Controls extends Phaser.Scene {
super("controls");
}

init(data, language) {
this.language = language;
this.spanish = data.spanish;
this.english = data.english;
this.portuguese = data.portuguese;
}

create() {

this.add.image(400, 300, "fondo");
const menuB = this.add.text(30, 30, "Menu", {
fontFamily: "Verdana",
}).setInteractive();
menuB.on("pointerover", () => {
this.game.canvas.style.cursor = "pointer"
menuB.setStyle({ fill: "#92f2cf" });
});
menuB.on("pointerout", () => {
this.game.canvas.style.cursor = "default";
menuB.setStyle({ fill: "#ffffff" });
});
menuB.on("pointerdown", () => {
this.game.canvas.style.cursor = "default";
init(data, language) {
this.language = language;
this.spanish = data.spanish;
this.english = data.english;
this.portuguese = data.portuguese;
}

this.scene.start("menu");
});
}
create() {
this.add.image(400, 300, "fondo");
const menuB = this.add.text(30, 30, "Menu", {
fontFamily: "Verdana",
}).setInteractive();
menuB.on("pointerover", () => {
this.game.canvas.style.cursor = "pointer"
menuB.setStyle({ fill: "#92f2cf" });
}).on("pointerout", () => {
this.game.canvas.style.cursor = "default";
menuB.setStyle({ fill: "#ffffff" });
}).on("pointerdown", () => {
this.game.canvas.style.cursor = "default";
this.scene.start("menu");
});
}

update() {
if (this.spanish === true) {
this.add.image(400, 320, "ayuda");
} else if (this.english === true) {
this.add.image(400, 320, "help");
} else if (this.portuguese === true) {
this.add.image(400, 300, "ajuda");
}
update() {
if (this.spanish === true) {
this.add.image(400, 320, "ayuda");
} else if (this.english === true) {
this.add.image(400, 320, "help");
} else if (this.portuguese === true) {
this.add.image(400, 300, "ajuda");
}
}
}
128 changes: 63 additions & 65 deletions src/scenes/Credits.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,72 @@ import { getTranslations, getPhrase } from "../services/translations";
import keys from "../enums/keys";

export default class Credits extends Phaser.Scene {
wasChangedLanguage = TODO;
wasChangedLanguage = TODO;

constructor() {
super("credits");
const {Artist, Programmers} = keys.Credits;
this.Artist = Artist;
this.Programmers = Programmers;
}
constructor() {
super("credits");
const {Artist, Programmers} = keys.Credits;
this.Artist = Artist;
this.Programmers = Programmers;
}

init(language) {
this.language = language;
}
init(language) {
this.language = language;
}

create() {
;
this.add.image(400, 300, "fondo");
this.add.image(400, 300, "credits")
this.art = this.add.text(this.cameras.main.width / 2, 200, getPhrase(this.Artist), {
fontSize: "25px",
fontFamily: "cursive",
}).setOrigin(0.5);
this.add.text(this.cameras.main.width / 2, 230, "Naomi Robinson (Nao.Robinson7@gmail.com)", {
fontFamily: "cursive"
}).setOrigin(0.5);
this.program = this.add.text(this.cameras.main.width / 2, 260, getPhrase(this.Programmers), {
fontSize: "25px",
fontFamily: "cursive",
}).setOrigin(0.5);
this.add.text(this.cameras.main.width / 2, 300, "Bianca Ercole (biancaercole2003@gmail.com) \nValentín Planisich (valeplanisich@gmail.com)", {
fontFamily: "cursive",
align: "center",
}).setOrigin(0.5);
this.add.text(this.cameras.main.width /2, 400, "TEAM WHISKERS", {
fontFamily: "cursive",
fontSize: "40px"
}).setOrigin(0.5);
const menuB = this.add.text(30, 30, "Menu", {
fontFamily: "Verdana",
}).setInteractive();
menuB.on("pointerover", () => {
this.game.canvas.style.cursor = "pointer"
menuB.setStyle({ fill: "#92f2cf" });
});
menuB.on("pointerout", () => {
this.game.canvas.style.cursor = "default";
menuB.setStyle({ fill: "#ffffff" });
});
menuB.on("pointerdown", () => {
this.game.canvas.style.cursor = "default";
create() {
this.add.image(400, 300, "fondo");
this.add.image(400, 300, "credits")
this.art = this.add.text(this.cameras.main.width / 2, 200, getPhrase(this.Artist), {
fontSize: "25px",
fontFamily: "cursive",
}).setOrigin(0.5);
this.add.text(this.cameras.main.width / 2, 230, "Naomi Robinson (Nao.Robinson7@gmail.com)", {
fontFamily: "cursive"
}).setOrigin(0.5);
this.program = this.add.text(this.cameras.main.width / 2, 260, getPhrase(this.Programmers), {
fontSize: "25px",
fontFamily: "cursive",
}).setOrigin(0.5);
this.add.text(this.cameras.main.width / 2, 300, "Bianca Ercole (biancaercole2003@gmail.com) \nValentín Planisich (valeplanisich@gmail.com)", {
fontFamily: "cursive",
align: "center",
}).setOrigin(0.5);
this.add.text(this.cameras.main.width /2, 400, "TEAM WHISKERS", {
fontFamily: "cursive",
fontSize: "40px"
}).setOrigin(0.5);
const menuB = this.add.text(30, 30, "Menu", {
fontFamily: "Verdana",
}).setInteractive();

this.scene.start("menu");
});
}
menuB.on("pointerover", () => {
this.game.canvas.style.cursor = "pointer"
menuB.setStyle({ fill: "#92f2cf" });
}).on("pointerout", () => {
this.game.canvas.style.cursor = "default";
menuB.setStyle({ fill: "#ffffff" });
}).on("pointerdown", () => {
this.game.canvas.style.cursor = "default";
this.scene.start("menu");
});
}

update() {
if (this.wasChangedLanguage === FETCHED) {
this.wasChangedLanguage = READY;
this.art.setText(getPhrase(this.Artist));
this.program.setText(getPhrase(this.Programmers));
}};

updateWasChangedLanguage = () => {
this.wasChangedLanguage = FETCHED;
};

async getTranslations(language) {
this.language = language;
this.wasChangedLanguage = FETCHING;
await getTranslations(language, this.updateWasChangedLanguage);
}
update() {
if (this.wasChangedLanguage === FETCHED) {
this.wasChangedLanguage = READY;
this.art.setText(getPhrase(this.Artist));
this.program.setText(getPhrase(this.Programmers));
}
};

updateWasChangedLanguage = () => {
this.wasChangedLanguage = FETCHED;
};

async getTranslations(language) {
this.language = language;
this.wasChangedLanguage = FETCHING;
await getTranslations(language, this.updateWasChangedLanguage);
}
}
48 changes: 21 additions & 27 deletions src/scenes/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default class Game extends Phaser.Scene {
document.body.appendChild(this.passwordInput);
// mostrar popup
if (!this.popupShown) {
this.showPopup();
this.showPopup(this.spanish, this.portuguese, this.english);
};
// nombre del usuario
const user = this.firebase.getUser();
Expand Down Expand Up @@ -278,8 +278,8 @@ export default class Game extends Phaser.Scene {
await getTranslations(language, this.updateWasChangedLanguage);
}

newLevel() {
if (this.level < 3) {
newLevel(level) {
if (level < 3) {
this.level += 1;
this.popupShown = false;
this.scene.start(("game"),{
Expand All @@ -293,7 +293,7 @@ export default class Game extends Phaser.Scene {
events.emit("passLevel", {
level: this.level,
});
} else if (this.level === 3) {
} else if (level === 3) {
this.scene.start("victory");
this.passwordInput.style.display = 'none';
}
Expand Down Expand Up @@ -393,45 +393,39 @@ export default class Game extends Phaser.Scene {

outDoor(door, player) {
console.log(door, player);
// this.user = this.firebase.getUser();
// this.firebase.saveGameData(this.user.uid, {
// tiempo: this.tiempo,
// });

if(this.level === 0 ||this.correctPassword === true){
this.user = this.firebase.getUser();
this.firebase.saveGameData(this.user.uid, {
tiempo: this.tiempo,
});
console.log ("paso")
this.newLevel();
this.newLevel(this.level);
const user = this.firebase.getUser();
this.firebase.loadGameData(user.uid).then((score) => {
console.log(score);
});
};
};

showPopup() {
showPopup(spanish, portuguese, english) {
let popKey;
this.popUp= true;
if (this.spanish) {
this.esPop = this.add.image(420, this.cameras.main.height / 2, this.popupKeyEs).setScrollFactor(0);
} else if (this.english) {
this.enPop = this.add.image(420, this.cameras.main.height / 2, this.popupKeyEn).setScrollFactor(0);
} else if (this.portuguese) {
this.brPop = this.add.image(420, this.cameras.main.height / 2, this.popupKeyBr).setScrollFactor(0);
};

if (spanish) {
popKey = this.popupKeyEs;
} else if (english) {
popKey = this.popupKeyEn;
} else if (portuguese) {
popKey = this.popupKeyBr;
}

const popImage = this.add.image(420, this.cameras.main.height / 2, popKey).setScrollFactor(0);

this.popupShown = true;
this.time.delayedCall(4000, () => {
if (this.spanish) {
this.esPop.destroy();
this.popUp = false;
} else if (this.english) {
this.enPop.destroy();
this.popUp = false;
} else if (this.portuguese) {
this.brPop.destroy();
this.popUp = false;
};
popImage.destroy();
this.popUp = false;
});
};

Expand Down
Loading

0 comments on commit b2af07b

Please sign in to comment.