SFML community forums

Help => General => Topic started by: James A on September 01, 2017, 08:23:00 am

Title: Issue with SFML Game Development book example
Post 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
Title: Re: Issue with SFML Game Development book example
Post by: eXpl0it3r on September 01, 2017, 11:18:32 am
Should work fine. What's your OS?
Title: Re: Issue with SFML Game Development book example
Post by: James A on September 01, 2017, 11:21:45 am
Should work fine. What's your OS?
My OS is Windows 10.
Title: Re: Issue with SFML Game Development book example
Post by: eXpl0it3r on September 01, 2017, 04:07:34 pm
So when you run it in debug mode, do you get key press events?
Title: Re: Issue with SFML Game Development book example
Post by: James A on September 02, 2017, 01:17:07 am
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.
Title: Re: Issue with SFML Game Development book example
Post by: eXpl0it3r on September 02, 2017, 10:16:29 am
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.