Graphics Reference
In-Depth Information
public bool IsFinished ()
{
return raceControl.GetIsFinished();
}
GetCurrentLap() looks to the race controller to find out what lap this player is cur-
rently racing to use as a return value:
public int GetCurrentLap ()
{
return raceControl.GetCurrentLap();
}
The race controller can tell us which waypoint the player is currently at via Get
CurrentWaypointNum():
public int GetCurrentWaypointNum ()
{
return raceControl.GetCurrentWaypointNum();
}
The race controller tracks distance from the player to its next waypoint, available via
its GetCurrentWaypointDist() function:
public float GetCurrentWaypointDist ()
{
return raceControl.GetCurrentWaypointDist();
}
When all of the waypoints have been passed, but the player has not yet passed the
start/finish line to increase the lap number, IsLapDone() will return true. Again, this is
something held by the race controller:
public bool IsLapDone ()
{
return raceControl.GetIsLapDone();
}
As a player is spawned by the game controller, it calls upon SetWayController() to tell
the race controller about the instance of Waypoints_Controller it should be using:
public void SetWayController( Waypoints_Controller aControl )
{
raceControl.SetWayController(aControl);
}
OnCollisionEnter is called when a collision occurs between the vehicle's Collider and
another Collider in the game world:
void OnCollisionEnter(Collision collider)
{
If this is an AI controlled player, to register as a hit, the other collider involved in the
collision needs to be on layer 9 (the layer used by user-controlled player projectiles). The
hit will not register if either isRespawning or isInvulnerable is true:
Search WWH ::




Custom Search