home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
eroticos
/
spankthebooty.swf
/
scripts
/
__Packages
/
ScoreKeeper.as
< prev
next >
Wrap
Text File
|
2005-10-13
|
876b
|
38 lines
class ScoreKeeper
{
static var totalScores = 0;
static var numScores = 0;
static var latestScore = 0;
function ScoreKeeper()
{
}
static function reset()
{
ScoreKeeper.numScores = 0;
ScoreKeeper.totalScores = 0;
ScoreKeeper.latestScore = 0;
}
static function addScore(score)
{
ScoreKeeper.totalScores += score;
ScoreKeeper.numScores = ScoreKeeper.numScores + 1;
ScoreKeeper.latestScore = score;
}
static function getNumScores()
{
return ScoreKeeper.numScores;
}
static function getLatestScore()
{
return Math.round(ScoreKeeper.latestScore);
}
static function getAverageScore()
{
if(ScoreKeeper.numScores == 0)
{
return 0;
}
return Math.round(ScoreKeeper.totalScores / ScoreKeeper.numScores);
}
}