Hi! I hope you are having a good day or night or whatever. I come to you because I am currently working on a game project and I am stuck doing the collisions because for some reason the invisible rectangle made to serve has the collision box of the character is offset, like its not on the center of the character. When it collides with a tile on the right it creates a bigger gap than it does on the left.
I have been following this tutorial and so far it has been incredibly helpful, until now.
https://youtu.be/oPzPpUcDiYY?si=W98I88btmC0LyZrb
I also will provide my own code if necessary (Which I guess it is going to be), but it is not going to fit here so, yeah.
In this video, we will implement collision detection so player character stops when he tries to walk through solid tiles.
Caution: This is a tutorial for Java 2D beginners so it's pretty verbose! (and the pacing is a bit slow...)
If you want to use my assets (images/maps/sound) that are used in this tutorial, here's the link:
https://drive.goo...
