Building the Menu and Making It Rain
In this chapter, we will implement two significant features. One of them is a menu screen to keep the player informed of their options for starting, pausing, restarting, and quitting the game. The other job will be to create a simple rain effect. You could argue that the rain effect isn’t necessary, or even that it doesn’t fit the game, but it is easy, fun, and a good trick to learn. What you should expect by now, and yet is still perhaps the most interesting aspect of this chapter, is how we will achieve both these objectives by coding classes derived from Graphics
and Update
, composing them in GameObject
instances, and they will just work alongside all our other game entities.
This is what’s coming up in this chapter:
- Building an interactive menu
- Coding the
MenuUpdate
class - Coding the
MenuGraphics
class - Building a menu in the factory
- Making it rain
- Coding the
RainGraphics
class...