diff --git a/js/game.js b/js/game.js index 1a452a3..11518b1 100644 --- a/js/game.js +++ b/js/game.js @@ -103,8 +103,8 @@ function updateBullets(list,target,dt) list[i].checkCollisions(target,squares,circles); if(list[i].deleted) { - list.splice(i,1); Renderer.remBullet(list[i]); + list.splice(i,1); } } } diff --git a/js/render.js b/js/render.js index 0ed9115..ddbea68 100644 --- a/js/render.js +++ b/js/render.js @@ -44,9 +44,9 @@ class Render { this.ctx.rotate(player.angle); this.ctx.drawImage(imgPlayer, -playerSize / 2, -playerSize / 2, playerSize, playerSize); this.ctx.restore(); - //this.ctx.fillStyle="#FF0000"; - //this.ctx.font="10pt arial"; - //this.ctx.fillText(player.name,player.x-player.name.length*10/3,player.y-playerSize/1.8); + this.ctx.fillStyle = 'white'; + this.ctx.font="10pt arial"; + this.ctx.fillText(player.name,player.x-player.name.length*10/3,player.y-playerSize/1.8); } RenderBullet(bullet) { @@ -54,9 +54,6 @@ class Render { this.ctx.translate(bullet.x, bullet.y); this.ctx.drawImage(imgBullet, -playerSize / 2, -playerSize / 2, playerSize, playerSize); this.ctx.restore(); - this.ctx.fillStyle = 'white'; - this.ctx.font="10pt arial"; - this.ctx.fillText(player.name,player.x-player.name.length*10/3,player.y-playerSize/1.8); } ReloadAff() {