Increase/decrease the velocity? Use an if statement? :idea:
If you don't know how to react to keyboard input, you should read the tutorials.
I have, this is what i got so far...
if (App.GetInput().IsKeyDown(sf::Key::D))
{
if(player.getEnergy()>100)
{
if(player.getPositionX()!= (game.getWidth()- 100))
{
player.Move(subVelocity * elapsedTime);
player.setEnergy(player.getEnergy()-1);
}
}
}
But everytime I try and use + or -, it starts having errors. Is there a better way?
[Edit]Doesn't Matter, done it now. Wow some really noobish errors in that coding. Haha, Thanks for the help.
Haxortiz[/Edit][/b]