So I've set some constructor that set the position and size of a Rectangle.
Now I want to do some statement testing, to check whether the rectangle ends up in a position were it isn't suppose to be.
So how can I do this? I know I can use the getPosition() to get the position of the rectangle, but how can I test that on an if statement? I want to test that the X position doesn't go over a certain X value as we'll as the Y, how can I do that? Just a small example will help, nothing big, most likely I'll understand but I'll remember once I see it
EDIT:
To get the x value of getPosition would I do this?
getPosition().x and getPosition().y
Or am I doing something wrong? Can't test since I'm away from a computer and away from an IDE
EDIT AGAIN
After some troubleshooting I figured out my problem!
I need to do as I said, getPosition().x > ....
Here how I did it
if(pongBall.BallShape.getPosition().y > windowY)
{
// do some code
}