EDIT: I've figured out why it doesn't work with using a simple cout to print it's coordinates. I'm curious to why it's the opposite of what I thought. As in why when you go up the y coordinate goes down and vice versa. Is there some mathematics or subject that will help me better understand this? I don't want a simple problem like this holding me back anymore
, as I have bigger fish to fry in the future. Or is this simply how the library is?
I'm making a basic little unrefined game.
I'm having trouble with making sure these sprites don't move off the screen.
My current code is this, but it fails obviously.
sf::Vector2f b1Pos = BOARD1.GetPosition();
if (App.GetInput().IsKeyDown(sf::Key::Up) && b1Pos.y < 600.f) BOARD1.Move(0, -200 * ElapsedTime);
this doesn't keep it from moving off the screen while the height of the screen is 600.
Also if this is an easy problem, just tell me why this doesn't work and maybe a few hints to figuring out what will.