diff --git a/webdev/game.js b/webdev/game.js index 7fbd9fe..ea09d4e 100644 --- a/webdev/game.js +++ b/webdev/game.js @@ -107,6 +107,7 @@ function setup(){ createCanvas(1250, 600); frameRate(244); // disable the outline of shapes + //declare the bullet with its variables myBullet = new bullet(playerPosX, playerPosY, 10, 20); noStroke(); @@ -117,7 +118,9 @@ function draw(){ keyPressed() // clear the background with a transparent black color background(0,0,0,100); + //draw the bullet myBullet.draw(); + //update de variabel playerPosX en playerPosY en de terugkomende variabelen hit en shot let { hit, shot } = myBullet.update(playerPosX, playerPosY); // draw a circle at the mouse position circle(playerPosX, playerPosY, radius);