Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Events not responding
Print
Pages: [
1
]
Author
Topic: Events not responding (Read 1300 times)
0 Members and 1 Guest are viewing this topic.
blobeb
Newbie
Posts: 3
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.
Logged
Ixrec
Hero Member
Posts: 1241
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.
Logged
Mosseman
Newbie
Posts: 5
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
;
}
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Events not responding
anything