Game Development Reference
In-Depth Information
The Finishing Touches
Now, this is a solid game. You've got enemies, you've got a player, and you've even
got a freaking
boss
! How cool is that? I'll tell you how cool—it's wicked cool! Now
only if it had a start screen and rounds that got more difficult. Oh, what the heck!
I've got a few more minutes. Let's wrap up the topic by adding those in. Let's add
in the following:
• Game rounds
• Increasing enemy difficulty with each round
• A title screen
Game rounds
Back in the day of classic games—we're talking the times of Pac-Man and Tetris—the
gameplay became more difficult with each playthrough of the game. Just like those
titles of yesteryear, we should have our example game become more difficult each
time you pass through it by defeating the boss. Start off by adding a new 3D Text
object called
Round
. Place it in the upper-right corner of the screen and set it up
exactly the way you did with the
Score
object, making it a child of the
Main Camera
object and everything. Also, set its
Alignment
field to
right
and its
Anchor
to
upper
right
so that it will properly show on the right-hand side of the screen.
Create a new script called
RoundWatcher
, attach it to the
Round
object, and make
it look like the following code:
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(TextMesh))]
public class RoundWatcher : MonoBehaviour
{