O'Reilly logo

SFML Game Development by Henrik Vogelius Hansson, Artur Moreira, Jan Haller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Command and Control – Input Handling

In the previous chapter, we talked about how to implement the world our game takes place in and the different objects that the world is made up of. In this chapter, we will focus on how to give the player the power to manipulate this world.

In this chapter we aim to learn:

  • SFML events and their purpose as input
  • SFML real-time input and its difference from events
  • A command-based communication system to deliver events in our world
  • How to dynamically bind keys at runtime

In the previous chapters, we have used events to manage input, but we have not really delved into what they are or what they are meant to be used for. That is the first point of this chapter. After that, we will look at more concepts of input ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required