Added comments

This commit is contained in:
Sam
2023-11-29 14:40:40 +01:00
parent efbe8b3358
commit 77ba652a69

View File

@@ -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);