Slick Forums

Colision detection :(
Page 1 of 1

Author:  Fliens [ Mon Dec 04, 2017 8:31 pm ]
Post subject:  Colision detection :(

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

upColides = true;

and that actually worked but when i added an else statement

upColides = true;
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 :(

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group