Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
SFML Game Development.pdf
Скачиваний:
209
Добавлен:
28.03.2016
Размер:
4.19 Mб
Скачать

Chapter 3

Summary

This chapter has moved away from the typical minimal examples, and has given you deeper insights to a possible game architecture. As always, keep in mind that we have chosen one of many design options—not every game needs a scene graph, sometimes a list of entities is enough.

In the next chapter you can expect information about handling both input events and real-time state of the keyboard and mouse. Also, you will learn about

command systems to deliver input to game entities as well as dynamic key binding mechanisms, which allow you to configure the set of controls of a game in runtime.

[ 83 ]

www.it-ebooks.info

www.it-ebooks.info

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 than just simply events.

www.it-ebooks.info

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]