Game Development Reference
In-Depth Information
9.5
34
42
54.5
89.5
108
127 46
!
land mines
player
moving platform
pendulum
cannon
laser
blizzard
!
enemy
Figure 10-3. Borders of zones identified by z-coordinate position
Any project can be broken down into component parts that make for manageable tasks. In this case,
you already have the obstacle course broken down into zones, so the methodical approach is to
take them one at a time in order.
Playtesting and Cheat Codes
It can get a little tedious to restart the game and run up the ramp each time the player character
gets killed while you are playtesting the obstacle course, but there is a way around this: you can
build in shortcuts.
This is the origin of cheat codes—game developers needed a way to quickly playtest a particular
behavior or feature of a game, and certain “cheats” such as invulnerability, infinite wealth, or super
power facilitated this. Today an entire industry has grown around cheat codes, and game developers
often purposefully leave them in the final production version.
Open your Obstacle Course scene if it isn't already. The first cheat code is going to reposition the
player character to the top of the ramp. In the Project panel Assets folder, create a new script named
Cheats. Open the script in MonoDevelop and edit the code as follows:
#pragma strict
public var player : GameObject;
function Start () {
player = GameObject.FindWithTag("Player");
}
function Update () {
if(Input.GetKeyDown(KeyCode.Alpha1)) {
if (player != null) {
player.transform.position = Vector3(0, 9, 18);
player.gameObject.GetComponent(GoRagdoll).ExitRagdoll();
}
}
}
 
Search WWH ::




Custom Search