noll-fyra / wdi-project-1-noll-fyra

wdi-project-1-noll-fyra created by GitHub Classroom
0 stars 0 forks source link

reset #2

Open primaulia opened 7 years ago

primaulia commented 7 years ago

Why do you need to iterate all the player item in this function?

noll-fyra commented 7 years ago

I’m checking if a player is hit. The other player may be not be.

function reset () { if (!isGameOver) { pArray.forEach(function (player) { if (player.hit) { zombieHitAudio.play() $('body').css('background-color', '#8a0707') $('body').css('transition', 'background-color 0.5s ease-out') setTimeout(function () { $('body').css('background-color', 'rgba(0, 0, 0, 0.0)') }, 300) player.hit = false player.isInvulnerable = true player.invulnerableTimer = 120 } })

On 30 Mar 2017, at 2:42 pm, Prima Aulia Gusta notifications@github.com wrote:

Why do you need to iterate all the player item in this function?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wdi-sg/wdi-project-1-noll-fyra/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AIyTgQ46dv0ZN9HqDV8h8O2UVkbXzi_Zks5rq07hgaJpZM4Mt7Wp.