Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Events not responding  (Read 1339 times)

0 Members and 1 Guest are viewing this topic.

blobeb

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Events not responding
« on: October 12, 2013, 10:33:09 am »
Whenever i press a button that has an action assigned to it my window freezes.

source code for the game.cpp class:
                                 http://pastebin.com/bAPH8HaQ

Thank you.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Events not responding
« Reply #1 on: October 12, 2013, 10:44:46 am »
It looks to me like userInput() will do an infinite loop whenever isPressed is true.

By the way, debuggers are great at catching silly, simple things like this.  Learn to use one ASAP and you'll save yourself a lot of headaches in the future.

Mosseman

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Events not responding
« Reply #2 on: October 12, 2013, 11:10:53 am »
void game::userInput(sf::Keyboard::Key key)
{
    if(key == sf::Keyboard::W)
        mIsMovingUp=true;
    else if(key == sf::Keyboard::S)
        mIsMovingDown=true;
}

 

anything