Hi it’s me again if you dont know who I am or what im talking about go here: http://www.java-gaming.org/topics/mr-rectangle-s-adventure/30816/msg/284913/view.html#msg284913 Ok if you download the file and go into the source code folder and open Keying.java and the character rectangle will not land on the topBox rectangle Please help ive tryed everything… :-\
Can you explain what the problem is?
I’m not going to download your game just to look at a section of code. Please post the relevant code and show us which lines are causing trouble. From what I can tell, I think you’re going about it the wrong way. You should be checking the box against the bounding box of the player by checking if the x coordinate of the player is greater than the box and do the same for the y component, also making sure to use the height of the objects. So, check x, x + width, y, y + height against the corresponding box coordinates and height/width. Essentially its an AABB, just Google it.
I actually fixed it i’m trying to remove this topic but i can’t in my 1.3 update it’s fixed and some new features are added
Topics cant be removed except for by administrators (at least I think).