CHAPTER 4

image

Scripting a Game Manager

In the last chapter we built the basic structure of the game. We have our bricks, paddle, and ball together in the scene and can destroy bricks by launching our ball. The game still needs the logic to keep track of how many bricks were destroyed and the framing of our scene to keep our ball in play.

In this chapter we will work with colliders to frame our scene and limit the area our ball can travel. We will also build a Game Manager object and script to control some of the objects in the game. In addition we add display text so our user knows the current game state.

Let’s make it happen!

Keeping Our Ball in ...

Get Make a 2D Arcade Game in a Weekend: With Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.