In turn-based games, game flow is partitioned into well-defined and visible parts, called turns. A player of a turn-based game is allowed a period of analysis (sometimes bounded, sometimes unbounded) before committing to a game action, ensuring a separation between the game flow and the thinking process, which in turn presumably leads to better choices. Once every player has taken his or her turn, that round of play is over, and any special shared processing is done. This is followed by the next round of play. In games where the game flow unit is time, turns may represent such things as years, months, weeks or days.
in that case just use sf::keyboard::iskeyReleasedEhrm have you ever worked wirh SFML? ;)
thats a basic thing to know
you always take the input from keyboard after releasing the key
this should solve your problem
QuoteIn turn-based games, game flow is partitioned into well-defined and visible parts, called turns. A player of a turn-based game is allowed a period of analysis (sometimes bounded, sometimes unbounded) before committing to a game action, ensuring a separation between the game flow and the thinking process, which in turn presumably leads to better choices. Once every player has taken his or her turn, that round of play is over, and any special shared processing is done. This is followed by the next round of play. In games where the game flow unit is time, turns may represent such things as years, months, weeks or days.
From:
http://en.wikipedia.org/wiki/Turns,_rounds_and_time-keeping_systems_in_games (http://en.wikipedia.org/wiki/Turns,_rounds_and_time-keeping_systems_in_games)
Ehrm have you ever worked wirh SFML? ;)
Such a function does not exist in sf::Keyboard. But one can use events with relased.
About turn based, I wasn't referring to the game itself, bit your statement made it seem like the mechnism should be called turn based. ;)
In this code, our functions are only called the moment when the keys are just pressed, so in order to activate them again, one must release the key then press it again.
What you actually need is to use sf::EventsIndeed, and don't forget:
If a key is held, multiple KeyPressed events will be generated, at the default OS delay (ie. the same delay that applies when you hold a letter in a text editor). To disable repeated KeyPressed events, you can call window.setKeyRepeatEnabled(false). On the contrary, obviously, KeyReleased events can never be repeated.