Can draw green dot with bullet class 🤬

This commit is contained in:
sam
2023-11-28 15:39:15 +01:00
parent 3ab02ab083
commit fa41b78969
2 changed files with 46 additions and 34 deletions

View File

@@ -72,8 +72,7 @@ let playerPosX = 500;
let playerPosY = 300;
let bullets = [];
let playerSpeed = 5;
let radius = 20;
let myBullet = new bullet();
let radius = 40;
async function Movementloop() {
if (booleanArray[1]) {
@@ -107,12 +106,15 @@ function setup(){
createCanvas(1250, 600);
frameRate(244);
// disable the outline of shapes
myBullet = new bullet();
noStroke();
myBullet(playerPosX, playerPosY, radius, 5);
}
// 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);