Difference between revisions of "C++ Input & Movement"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "=Keyboard Input= <syntaxhighlight lang=c++> if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) { // move left... } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Righ...")
(No difference)

Revision as of 13:13, 14 June 2019

Keyboard Input

if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
{
    // move left...
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
{
    // move right...
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
{
    // quit...
}

Mouse Input

Touch Input

Joystick Input