Achievements in Flixel
The FlxAchievementSystem is a class built on Flixel that handles global achievements for individual games. It utilizes flash's shared object (or FlxSave) to save achievement progress.
The FlxAchievementSystem is built out of 3 classes:
import org.flixel.plugin.chameneon.*;
Everything you need to be good to go is a static instance of FlxAchievementSystem (it should be static so you can unlock achievements from anywhere in your project).
public static var achievementSystem:FlxAchievementSystem;
private var achievements:Array =
[
new FlxAchievement("My first achievement", "Description"),
new FlxAchievement("My second achievement", "Description")
]
achievementSystem = new FlxAchievementSystem("name of save", achievements);
FlxG.addPlugin(achievementSystem);
To unlock achievements simply call the unlock() function.
To erase the progress on the savefile call erase().
I highly encourage you to contribute to this project as I would love to improve it.