Game Development Reference
In-Depth Information
We will use the 2D character sprite sheet (as shown in the previous image), and create the
sprite manager class to control it instead of the 3D character model. Some of you might have
a few quesions: Why are we doing this? Why don't we just use the 3D model, which should
be easier to do, instead of creaing the sprite manager class?
Well, there are some advantages of using a sprite manager class. Firstly, creaing a 3D model
and animaion takes ime. It takes more ime to create a simple 3D character with animaion
than to create a 2D character with a sprite sheet because you don't have to deal with the
polygon count, rigging the character, unwarping the textures, and animaing it. You just draw
it. Since the 2D sprite object only shows one view, we can use the plane object to save the
number of polygons instead of using the 3D character object. It is also an advantage to learn
this sprite technique to create an animated texture in your game.
The purpose of this chapter is to familiarize you with all the tools and language syntax
in Unity, which is very important to create a playable game. We will also see how to use
MonoDevelop for a JavaScript user (someimes called UnityScript; in the rest of the topic, we
will call it Unity JavaScript) and what is good about MonoDevelop when compared to Unitron
(or UniSciTE in PC).
What does it do?
In this project, we will start with creaing a camera for our game, and adding light and level
to the scene. Next, we want to create our character object as a plane, apply the transparent
material, and use the 2D graphic sprite sheet for its texture. We will also create the script,
which will control the sprite sheet to show the right graphic on our character object. This
script will allow us to be able to control our character to walk and jump by pressing the
arrow key. Also, we will learn how to set up the custom input manager. Then, we will have
the right animaion for the character idle, walking, or jumping.
For the level, we will create it by using a Unity built-in cube and give it a collision which will
react with the character by using a Unity built-in physics. To end the game, we will create a
trigger event by creaing a door and a key. The player needs to collect the key to open the
door and end the game. We will also add sound to make our game seem alive, but we are
not finishing it yet. The game needs to be replayable. Lastly, we will add a Replay or Play
again buton to replay our game by using destroy and instaniate to reset our character
posiion and key item.
 
Search WWH ::




Custom Search