PLS HELP
1. Define an integer variable, give it a random value between 0 and 100 using the random(100) command, If the number is less than 50, the program displays (less than 50) if the variable is more than 50 the program displays (More than 50). 2. code a ball moving towards the right, once it goes off the screen, it needs to reappear on the left side of the screen. 3. Make a ball going vertically up, once the ball is off the screen, it needs to reappear on the bottom of the screen.
code:
int value = 20;
String status = "";
void setup(){
size(500,500);
}
void draw(){
background(0,0,255);
fill(255,0,0);
ellipse(250,250,value,value);
text(status, 50, 400);
}
void keyPressed(){
if(key=='a'){
value = value+10;
}
if(key =='b'){
value = 10;
}
}
void mousePressed(){
status = "The size of the circle is " + value;
}