Hi..
Im trying to work out a game where the character movement is governed by arrow keys. I have used both :
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Right))
xspeed = 1.0f;
AND
if(Input.IsKeyDown(sf::Key::Right)) xspeed = 1.0f;
I do understand that the snippet 1 is present for single key presses and the latter one for situations with continous key presses. Now in my case, the latter one should be the solution since I want my character to keep moving till the time I release the arrow key.
To my misfortune, even when I press the right key (in this case) just once..my character shows a displacement which corresponds to more than 1 key hit event.. it shows an equivalent displacement of 2-3 key hits..
Any ideas.. how I can rectify this and why is the system behaving as it is ?
Thanks
Dexter[/code]