Hello.I've tried my best to make this collision work, but I simply can't. I tried every method, even copied the code from internet tutorial, but it simply won't work. It seems as if when the player is in the middle of two tiles, it won't work. Uh, I don't know how to explain it right, so I'll post some screenshots.

It works if the player is in a "full" tile.Click here to see the screenshot.

But, if a player is kind of in a "half" tile, it doesn't.Click here to see the screenshot.

What you need to do is to store the movements in a different variable (say, velX and velY), then check te bounds by axis. To check by axis you first check the coords (x, y+velY) then the coords (x+velX, y) or vice versa.

Actually, my collision checking method was correct, but I used it in a wrong context, for the lack of a term. My new method of doing it is drawing rectangles on the blocked tile spots. Maps gets drawn on top of those rectangles, so they're not visible. It works like a charm!

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