Sorry, I don't understand what you want to compare.
Okey, I will try to explain again, I´m not so good at english
btw, I have 2 classes, one with character and one with tile images, and I do´t want the character to run through the wall, so I need a function to check so the character will stop if try run through the wall (image), I have done it before, but not now when they are in diffrent classes.
So I can´t just write if( character.getPosition().x <= wall.getPosition().x)
because they are in different classes. So is there any ideas?
I guess I have to do it like change so the images is sprites with names. Like wall.getPosition for example. But I don´t now how.