I am trying to make a game about consuming balls and I have yet to find a solution for these two problems.
1- Making collision a one time thing without using a flag
2-Making my redorbs spawn exponantially after consuming one
for(int i = 0;i<redorb.length;i++){
redorb[i] = new Redorb();
.......
for(int i = 0;i<redorb.length;i++){
if(collide(redorb[i].redx,redorb[i].redy,posx,posy)==true){
//todo flag
health --;
mult++;
redorb[i].redorb();
}
}
......
class Redorb{
int redx = int(random(30,750));
int redy = int(random(30,750));
void redorb(){
reds.background(255,0);
reds.fill(255,0,0);
reds.ellipse(redx,redy,10,10);
}}