Game Development Reference
In-Depth Information
Implementing
the
core
classes
for
mission one
In this chapter, we will start creating mission one, which presents US geography to the
player (state name, flag, and trivia). Let's begin by creating the classes and
GameOb-
ject
instances for this level. To begin, create a new scene file and name it
TESTBED
.
Creating a terrain
Let's create a nice terrain mesh to replace the ground plane from the previous two
levels. With this, we can create a nice-looking mesh for the ground that resembles a
park with grass, mountains, and trees by performing the following steps:
1. In the
Assets
menu, navigate to
Import Package
|
Terrain Assets
. Click on
the
Import
button on the pop-up window that appears next to bring a library of
models and textures into Unity for use with the terrain editor.
2. To create a terrain mesh, let's navigate to
CreateOther
|
Terrain
, from the
GameObject
drop-down list.
3. On the
Set Heightmap resolution
pop up that appears, configure the para-
meters to the following values:
•
Terrain Width
,
Terrain Length
: The horizontal dimensions of the ter-
rain mesh. Set both to
500
units.
•
Terrain Height
: The maximum height of the terrain (for mountains and
so on). Set this to
500
units.
• The remaining parameters control the resolution of the textures that
are painted onto the terrain. Keep these at their defaults.