First project ever, and ended up with this "Syntax Error -- Maybe missing a right parenthesis?"
in
Programming Questions
•
1 year ago
The code for the project is
void setup () {
size( 400, 400);
size( 400, 400);
}
float ballX = 0;
float ballY = 0;
float speedX = 1;
float speedY = 2;
int hit = 0;
int miss = 0;
float ballY = 0;
float speedX = 1;
float speedY = 2;
int hit = 0;
int miss = 0;
void draw() {
float paddle = 100;
if(ballX < 0 || ballX > width) speedX = -speedX;
if(ballY > height)
(speedY = -speedY;
float distance = abs(mouseX - ballX);
if(distance < paddle) hit += 1;
else miss += 1;
)else speedY += 1;
ballX += speedX;
ballY += speedY;
background( 255, 0, 255);
ellipse(ballX, ballY, 50, 50);
rect(mouseX-100, height-10, 2*paddle, 10);
text("hit: " + hit, 10, 10);
text("miss: " = miss, 10, 40);
}
float paddle = 100;
if(ballX < 0 || ballX > width) speedX = -speedX;
if(ballY > height)
(speedY = -speedY;
float distance = abs(mouseX - ballX);
if(distance < paddle) hit += 1;
else miss += 1;
)else speedY += 1;
ballX += speedX;
ballY += speedY;
background( 255, 0, 255);
ellipse(ballX, ballY, 50, 50);
rect(mouseX-100, height-10, 2*paddle, 10);
text("hit: " + hit, 10, 10);
text("miss: " = miss, 10, 40);
}
Any help for the mistakes made would be greatly appreciated

1