SFML community forums
Help => General => Topic started by: James A on September 01, 2017, 08:23:00 am
-
Hi,
I am reading through 'SFML Game Development' and I was up to the first example - getting a player to move a circle with WASD. Unfortunately, after going through the steps, when I ran my code the circle did nothing. Furthermore, I ran the example off github and It didn't do anything either. My goal is to get this to work. Do you have any advice?
Github links:
https://github.com/SFML/SFML-Game-Development-Book/blob/master/01_Intro/Include/Book/Game.hpp
https://github.com/SFML/SFML-Game-Development-Book/blob/master/01_Intro/Source/Game.cpp
https://github.com/SFML/SFML-Game-Development-Book/blob/master/01_Intro/Source/Main.cpp
-
Should work fine. What's your OS?
-
Should work fine. What's your OS?
My OS is Windows 10.
-
So when you run it in debug mode, do you get key press events?
-
So when you run it in debug mode, do you get key press events?
Yes. I changed the handlePlayerInput function to print what key was pressed, however, as I said, the circle is not doing anything.
-
The question was whether the events get triggered or not.
Start your debugger and step to the program to figure out where things go wrong.