What are the types on pastX/pastY/x/y?Is the object trembling around?And why is delta an int?

My shallow knowledge tells me that something in line 9 and/or 16 is messing up your stew: If delta == 0, your Y position doesn't change at all, and no collision is found (since you are checking collisions with your actual position), hence the yCollision = false statement.

anything related to positions is a double, the object isn't trembling, and I use an int because I feel like it's easier to work with.I can't provide the doesCollideOnY method because this is part of an abstract class so it's different for everything that extends it. @Rorkien It's supposed to run every 16 milliseconds. delta should always be 16. What do you suppose I do to fix this then?

I usually fill the method with println() to grab and compare all the possible data (mad debug skillz).Try grabbing the nextY value right after line 16 and check if it's changing right along with yCollision

Well, I threw some println statements in there and every once in a while, the velocity will be a little bit less than usual. the only way that that makes any sense would be if delta is lower than 16, which doesn't really make any sense.

It could be that the lastposition push is further away than the gravitational pull in one cycle. That would explain why it´s only happening in the y-axis. How random is "yCollide == false"? Is it just once in a while or do the object sometimes get stuck in a false state?

If the delta gets too large and the objects are moving fast, it could also happen that they are tunneling through surfaces.A simple solution is to break down the delta and put the collision check into a loop to check the whole movement path.

Lethal Running - a RPG about a deadly game show held in a futuristic dysoptian society.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org