Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
diirtysanch
diirtysanch's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
First project ever, and ended up with this "Syntax Error -- Maybe missing a right parenthesis?"
[2 Replies]
02-Sep-2012 06:47 PM
Forum:
Programming Questions
The code for the project is
void setup () {
size( 400, 400);
}
float ballX = 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);
}
Any help for the mistakes made would be greatly appreciated
«Prev
Next »
Moderate user : diirtysanch
Forum