Added comments
This commit is contained in:
@@ -107,6 +107,7 @@ function setup(){
|
|||||||
createCanvas(1250, 600);
|
createCanvas(1250, 600);
|
||||||
frameRate(244);
|
frameRate(244);
|
||||||
// disable the outline of shapes
|
// disable the outline of shapes
|
||||||
|
//declare the bullet with its variables
|
||||||
myBullet = new bullet(playerPosX, playerPosY, 10, 20);
|
myBullet = new bullet(playerPosX, playerPosY, 10, 20);
|
||||||
|
|
||||||
noStroke();
|
noStroke();
|
||||||
@@ -117,7 +118,9 @@ function draw(){
|
|||||||
keyPressed()
|
keyPressed()
|
||||||
// clear the background with a transparent black color
|
// clear the background with a transparent black color
|
||||||
background(0,0,0,100);
|
background(0,0,0,100);
|
||||||
|
//draw the bullet
|
||||||
myBullet.draw();
|
myBullet.draw();
|
||||||
|
//update de variabel playerPosX en playerPosY en de terugkomende variabelen hit en shot
|
||||||
let { hit, shot } = myBullet.update(playerPosX, playerPosY);
|
let { hit, shot } = myBullet.update(playerPosX, playerPosY);
|
||||||
// draw a circle at the mouse position
|
// draw a circle at the mouse position
|
||||||
circle(playerPosX, playerPosY, radius);
|
circle(playerPosX, playerPosY, radius);
|
||||||
|
Reference in New Issue
Block a user