I did 2 Arrays of floats to make X and Y positions for a collision system that uses dist(); but I dont know how to put the arrays information on it.
The function must work for 15 ellipses that are not implementated but first I need to set the array numbers on the dist(); so I dont have to repeat the code for every single ellipse.
float yp[] = {60.0, 130.0, 250.0, 420.0, 1245.0, 985.0, 655.0, 228.0, 179.0, 568.0, 1174.0, 445.0, 792.0, 1066.0, 750.0};
float xp[] = {908.0, 198.0, 248.0, 273.0, 206.0, 180.0, 269.0, 108.0, 991.0, 224.0, 257.0, 576.0, 204.0, 371.0};
void obstacles(){
**if(dist(x+=xSpeed, y+=xSpeed, xp[], yp[]) < Rad)**
//That is where I need help, how I can implementate all the array on the xp[] and yp[] place?
{
if(xSpeed >0){
xSpeed = -1;
}
else if(xSpeed < 0){
xSpeed = 1;
}
if(ySpeed > 0){
ySpeed = -1;
}
else if(ySpeed < 0){
ySpeed = 1;
}
}
}