hey i'm trying to program a coliosion detection and i basically want a boolean switch to true if the shape(rectangle) "hitBoxUp" colides with a shape from the arraylist "shapes" but when hitBoxUp intersects a shape from "shapes" it doesn't change. I tried it with
if(hitBoxUp.intersects(shapes)){
upColides = true;
}
and that actually worked but when i added an else statement
if(hitBoxUp.intersects(shapes)){
upColides = true;
}else{
upColides = false;
}
it wont change anymore.
Right now i tried it this way:
for (Shape shapes : Obstacles.ObstaclesSetup.hindernisse) {
upColides = hitBoxUp.intersects(shapes);
downColides = hitBoxDown.intersects(shapes);
leftColides = hitBoxLeft.intersects(shapes);
rightColides = hitBoxRight.intersects(shapes);
}
But that wont work either
