Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
junk.amajbri
junk.amajbri's Profile
1
Posts
1
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
The operator && is undefined for the argument type(s) boolean, int
[4 Replies]
25-Sep-2013 06:57 PM
Forum:
Programming Questions
Hello, I'm new to processing but and I really don't understand why this isn't working. Any help will be much appreciated. Thanks
/*
*To do list*
1. Get paddle to work
*/
float ellipseRadius;
//ball start position
float ellipseX;
float ellipseY;
//ball speed
float ballSpeedx;
float ballSpeedy;
void setup(){
size(1280,720);
frameRate(30);
ellipseRadius = 50; //ball size
//ball start position
ellipseX = 50;
ellipseY = 50;
//ball speed
ballSpeedx = 10;
ballSpeedy = 10;
}
void draw(){
background(0,123,167);
ellipseMode(CENTER);
fill(255,127,0);
ellipse(ellipseX,ellipseY,ellipseRadius, ellipseRadius);
ellipseX = ellipseX + ballSpeedx; //moves ball across x axis
ellipseY = ellipseY + ballSpeedy; // moves ball down y axis
if(ellipseX + ellipseRadius/2 > (width-47) && (mouseY - 13) && (mouseY + 13) || ellipseX - ellipseRadius/2 < 0){
ballSpeedx = -ballSpeedx;
}
if(ellipseY + ellipseRadius/2 > height || ellipseY - ellipseRadius/2 < 0){
ballSpeedy = -ballSpeedy;
}
fill(255,0,0);
rectMode(CENTER);
rect(width-30, mouseY, 26, 100);
}
«Prev
Next »
Moderate user : junk.amajbri
Forum