WEEK SCORE SHIT
This commit is contained in:
@ -21,6 +21,21 @@ class Highscore
|
||||
setScore(daSong, score);
|
||||
}
|
||||
|
||||
public static function saveWeekScore(week:Int = 1, score:Int = 0, ?diff:Int = 0):Void
|
||||
{
|
||||
NGio.postScore(score, "Week " + week);
|
||||
|
||||
var daWeek:String = formatSong('week' + week, diff);
|
||||
|
||||
if (songScores.exists(daWeek))
|
||||
{
|
||||
if (songScores.get(daWeek) < score)
|
||||
setScore(daWeek, score);
|
||||
}
|
||||
else
|
||||
setScore(daWeek, score);
|
||||
}
|
||||
|
||||
/**
|
||||
* YOU SHOULD FORMAT SONG WITH formatSong() BEFORE TOSSING IN SONG VARIABLE
|
||||
*/
|
||||
@ -52,6 +67,14 @@ class Highscore
|
||||
return songScores.get(formatSong(song, diff));
|
||||
}
|
||||
|
||||
public static function getWeekScore(week:Int, diff:Int):Int
|
||||
{
|
||||
if (!songScores.exists(formatSong('week' + week, diff)))
|
||||
setScore(formatSong('week' + week, diff), 0);
|
||||
|
||||
return songScores.get(formatSong('week' + week, diff));
|
||||
}
|
||||
|
||||
public static function load():Void
|
||||
{
|
||||
if (FlxG.save.data.songScores != null)
|
||||
|
Reference in New Issue
Block a user