We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I am having difficulties making the red circle appear after it has left the screen, it stars at a random point on the x atis and below the y axis then it goes up.
int a = 5; //"a" value for Red balloon
float x = random(100,400);
void setup() {
size(500,500);
}
void draw() {
background(255);
//Red balloon
fill(255,0,0);
ellipse(x,530+a,30,30);
a= a-2;
//crosshair
line(mouseX, mouseY-7, mouseX, mouseY-24); //vertical bar
line(mouseX-12,mouseY-12,mouseX,mouseY-12); //left bar
line(mouseX+12,mouseY-12,mouseX,mouseY-12); //right bar
//bullet
if (mousePressed) { //black dot on crosshairs
fill(0);
ellipse(mouseX+.49998,mouseY-12,5,5);
}
if (a<0){
a=a;
}
}//end of draw
Also how would I make it that when the crosshair is over the ballon and the mouse is pressed the ballon will be deleted, but then another balloon is spawned eventually? P.S the crosshair's have been adjusted to be 12 units above the y axis, while still on the same x axis. I believe I have to use boolean to make this happen, but I do not have much experience with boolean.
Answers
I've got an online Pop Bubbles. Maybe you can use something from the code there? ;;)
http://studio.processingtogether.com/sp/pad/export/ro.9ZKbYJpM0CfPR/latest
Quite useless... Perhaps you mean
a = -a;
Although I still don't see the point.Mmm, I was wondering what was this 'a' value. Given its usage, I think it is more traditionally called y.
So, it should be: