From b8ddc4dc0516d0ab501779cb154a9a299dbfe16f Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 28 Nov 2023 15:59:46 +0100 Subject: [PATCH] added update class function --- webdev/game.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webdev/game.js b/webdev/game.js index ef2ef3d..9cc3241 100644 --- a/webdev/game.js +++ b/webdev/game.js @@ -106,7 +106,7 @@ function setup(){ createCanvas(1250, 600); frameRate(244); // disable the outline of shapes - myBullet = new bullet(); + myBullet = new bullet(playerPosX, playerPosY, 10, 20); noStroke(); } @@ -114,10 +114,10 @@ function setup(){ // the function draw() is called every frame function draw(){ keyPressed() - myBullet.draw(playerPosX, playerPosY, 10, 5); // clear the background with a transparent black color background(0,0,0,10); - + myBullet.draw(); + myBullet.update(); // draw a circle at the mouse position circle(playerPosX, playerPosY, radius); }