Hello JGO, I've had this weird issue every time I try to program collision into a game lol.

I am trying to implement Collision for Rectangle Vs. Rectangle.As we all know a rectangle has 4 sides, thus there's 4 sides to check collision for My collision works perfect, I just cannot get it to work on ALL 4 SIDES >...<

At the moment I can basically 'pick' which 2 sides (top/bottom -or- left/right) of a tile will have active collision areas.

1. Create a new position by adding the total velocity to the current position.2. Check (currentX, newY) for collisions.3. If there is a collision, don't do anything. If there isn't, set currentY to newY.4. Check (newX, currentY) for collisions.5. If there is a collision, don't do anything. If there isn't, set currentX to newX.

1. Create a new position by adding the total velocity to the current position.2. Check (currentX, newY) for collisions.3. If there is a collision, don't do anything. If there isn't, set currentY to newY.4. Check (newX, currentY) for collisions.5. If there is a collision, don't do anything. If there isn't, set currentX to newX.

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