Search the Community
Showing results for tags 'exist'.
-
helo. pls someone correct me. my hero will throw coins to homeless people. and i wanna add a time limit for the coin. the problem is i dont know how to target the event's object. sry for my eng and ty for any advice function update() { if (cursors.down.isDown && timerFire == 0){ console.log('pina'); timerFire = 20; var penz = bullets.getFirstExists(false); penz.timeleft = 100; if (facing === 'right') { penz.reset(player.x +10, player.y ); penz.body.velocity.y=-200; penz.body.velocity.x=200; } else { penz.reset(player.x -10, player.y); penz.body.velocity.y=-200; penz.body.velocity.x=-200; } } if (timerFire != 0){ timerFire--; } bullets.callAllExists(csokkentes, true); function csokkentes(e:target){ if (e.timeLeft != 0) { e.timeLeft--; } else { e.exists = false; } }