Game Development Reference
In-Depth Information
// Boss is waiting to fall to another node
if(timeForNextEvent == 0.0f)
{
timeForNextEvent = Time.time + eventWaitDelay;
}
else if(timeForNextEvent < Time.time)
{
// Need to find a new node!
targetNode = dropNodeList
[ Random.Range(0,dropNodeList.Count) ];
// Set the boss position to the sky position of
// this node
transform.position =
getSkyPositionOfNode(targetNode);
// Set the event state
currentEvent = bossEvents.fallingToNode;
timeForNextEvent = 0.0f;
}
break;
case bossEvents.waitingToJump:
// Boss is on a platform and is just waiting to
//jump off of it
if(timeForNextEvent == 0.0f)
{
timeForNextEvent = Time.time + eventWaitDelay;
}
else if(timeForNextEvent < Time)
{
// Build the target position based on the
// current node
targetPosition =
getSkyPositionOfNode(targetNode);
// Set our event state
currentEvent = bossEvents.jumpingOffPlatform;
timeForNextEvent = 0.0f;
// Also set the target node to null so we know
// to find a random one when it's time to fall
// to one again
 
Search WWH ::




Custom Search