diff --git a/js/class.js b/js/class.js index fac577c..c73dd75 100644 --- a/js/class.js +++ b/js/class.js @@ -105,7 +105,7 @@ class Player function dist(A,B) { - return sqrt((A.x-B.x)**2+(A.y-B.y)**2); + return Math.sqrt((A.x-B.x)**2+(A.y-B.y)**2); } class Bullet diff --git a/js/game.js b/js/game.js index 11518b1..d7f56a1 100644 --- a/js/game.js +++ b/js/game.js @@ -89,9 +89,8 @@ function addBullets() if (bulletsToAdd.length==0) return; bulletsToAdd.forEach((b) => { - console.log("new bullet"); - bullets.push(p); - Renderer.addBullet(p); + bullets.push(b); + Renderer.addBullet(b); }); }