Skip to content
Snippets Groups Projects
Commit 95ffe59d authored by Mathis Decoster's avatar Mathis Decoster :apple:
Browse files

details

parent 89e7e2e8
Branches
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ let gameStarted = false;
const canvas = document.querySelector('.gameCanvas');
const context = canvas.getContext('2d');
const avatar = new Avatar('julien', 1);
const avatar = new Avatar('1', 1);
renderObject.imageMortier.addEventListener('load', () => {
avatar.setImageCanvas(renderObject.imageMortier, canvas);
......@@ -79,7 +79,6 @@ function render() {
context.clearRect(0, 0, canvas.width, canvas.height);
renderObject.renderBackground(canvas);
gameStarted = affichage.isGameStarted();
console.log(gameStarted);
if (gameStarted) {
context.font = '40pt New Super Mario Font U';
for (let i = 1; i < avatars.length; i++) {
......@@ -135,6 +134,9 @@ function render() {
let avatars = [];
socket.on('disconnectEvent', id => {
if (avatar.getNom() == id) {
affichage.afficherFinDePartie();
}
avatars[id] = {};
});
......
......@@ -70,7 +70,6 @@ io.on('connection', socket => {
});
socket.on('start', s => {
console.log(s);
if (s == true && cpt != 0) {
gameStarted = s;
} else if (cpt == 0) {
......@@ -184,9 +183,8 @@ setInterval(() => {
}, 100);
}
if (avatar.getVies() == 0) {
//afficherFinDePartie();
avatar.initAvatar();
//t = new timer();
//TODO : afficher écran fin de partie de l'avatar concerné
}
}
if (enemi.getVies() < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment