The operator && is undefined for the argument type(s) boolean, int
in
Programming Questions
•
23 days ago
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);
}
1