My gravity script is extremely inefficient. Basically it brings down a 80 fps to a 4 fps by itself.
here it is:
public void Gravity(){
y+=Minions.gravity;
for (int i=0;i<c.size();i++){
if (bounds().intersects(c.get(i).bounds())){
if(c.get(i).destroyed==false){
y=c.get(i).y-9;
}
}
}
}
this gets called every frame
I know that it is the for loop that is causing all of the problems but i don’t know how to fix it