Game Development Reference
In-Depth Information
targetNode = null;
}
break;
case bossEvents.jumpingOffPlatform:
if(transform.position.y < targetPosition.y)
{
// MovespeedMoveSpeed is positive here, causing
// the object to move upwards
transform.Translate(new Vector3(0f,
MovespeedmoveSpeed * Time.deltaTime, 0f));
if(transform.position.y > targetPosition.y)
transform.position = targetPosition;
}
else
{
timeForNextEvent = 0.0f;
currentEvent = bossEvents.waitingToFall;
}
break;
}
}
public void beginBossBattle()
{
// Set the first falling node and have the boss
// fall towards it
targetNode = dropToStartNode;
currentEvent = bossEvents.fallingToNode;
// Reset various control variables used to track
// the boss battle
timeForNextEvent = 0.0f;
health = startHealth;
isDead = false;
}
Vector3 getSkyPositionOfNode(GameObject node)
{
Vector3 targetPosition =
targetNode.transform.position;
targetPosition.y += 9f;
 
Search WWH ::




Custom Search