Graphics Reference
In-Depth Information
focusPlayerScript.howMany_fraggedOthers contains a count of how many other
players this player has fragged.
There is code in this script for three different systems of a player moving up in rank.
The first one only takes into account the number of frags. Whichever player has fragged
the most others gets higher in the ranking. This is commented out in the example game,
as it uses the second ranking system further on in the script:
// if( focusPlayerScript.howMany_fraggedOthers >
// tempRC.howMany_fraggedOthers )
// isAhead=true;
When both players have fragged the same amount, ranking will be based on ID.
Higher ID will come first on the score board:
// we check here to see if the frag count is
// the same and if so we use the id to sort
// them instead
if( focusPlayerScript.howMany_fraggedOthers
== tempRC.howMany_fraggedOthers &&
focusPlayerScript.GetID() > tempRC.GetID() )
isAhead=true;
The third and final condition both takes the number of frags and subtracts it from the
number of times this player has been fragged:
if( ( focusPlayerScript.howMany_fraggedOthers - focusPlayerScript.
howmany_frags ) > ( tempRC.howMany_fraggedOthers -
focusPlayerScript.howmany_frags ) )
isAhead=true;
If one of the conditions has set isAhead to true, the myPos variable is decremented,
which moves the player up one in the rankings. The loop then either completes or goes
through this process again:
if ( isAhead )
{
myPos--;
}
}
}
return myPos;
}
The game controller will call StopBattle() when the game is over. StopBattle() sets bat-
tleRunning to false, then calls out UpdateBattleStates() to tell all of the battle controllers
about the change:
public void StopBattle()
{
// we don't want to keep calling everyone to tell them about
// the battle being over if we've already done it once, so
// check first battleRunning is true
if(battleRunning==true)
{
Search WWH ::




Custom Search