diff --git a/client/src/main.js b/client/src/main.js index 32989bf3ffff9874f8712ba76cdf5badb1fe03b2..e4297897de220dc5a6f48fbc0d6387667adda910 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -165,7 +165,7 @@ document.addEventListener('keyup', handleKeyEvent); function handleKeyEvent(event) { keysPressed[event.keyCode] = event.type === 'keydown'; - if (event.key === ' ') { + if (event.key === ' ' && gameStarted) { socket.emit('shoot', { id: `${socket.id}`, shoot: true, diff --git a/client/src/scoreboard.json b/client/src/scoreboard.json index 87bdae868ea27489aebf3952008ad659478218a7..1b0217ead38a7da53c3d40d5980939e15b31d3d4 100644 --- a/client/src/scoreboard.json +++ b/client/src/scoreboard.json @@ -76,6 +76,27 @@ "nom": "uu", "score": -15 }, + { + "score": -15 + }, + { + "score": -15 + }, + { + "score": -15 + }, + { + "score": -35 + }, + { + "score": 0 + }, + { + "score": -15 + }, + { + "score": -15 + }, { "score": -15 } diff --git a/server/index.js b/server/index.js index e2ced2535c8afbc7fb3cf783ffc3efbb88e09d12..9efc6a00de8d1635b9d6b4548c2e183c0ded65bb 100644 --- a/server/index.js +++ b/server/index.js @@ -325,7 +325,10 @@ function handleAvatarBonusCollisions(avatar) { if (bonus.hitbox.colision(avatar.hitbox)) { if (bonusNoms[bonus.getChoix()] == 'vie') { avatar.gagnerVie(); - } else if (bonusNoms[bonus.getChoix()] == 'invincibilite') { + } else if ( + bonusNoms[bonus.getChoix()] == 'invincibilite' || + !gameStarted + ) { avatar.setStatut('invincibilite'); avatar.setStatutTime(t.getTotalTime()); }