/
Reg.hx
42 lines (40 loc) · 1.31 KB
/
Reg.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package;
import org.flixel.FlxSave;
/**
* Handy, pre-built Registry class that can be used to store
* references to objects and other things for quick-access. Feel
* free to simply ignore it or change it in any way you like.
*/
class Reg {
/**
* Generic levels Array that can be used for cross-state stuff.
* Example usage: Storing the levels of a platformer.
*/
static public var levels:Array<Dynamic> = [];
/**
* Generic level variable that can be used for cross-state stuff.
* Example usage: Storing the current level number.
*/
static public var level:Int = 0;
/**
* Generic scores Array that can be used for cross-state stuff.
* Example usage: Storing the scores for level.
*/
static public var scores:Array<Dynamic> = [];
/**
* Generic score variable that can be used for cross-state stuff.
* Example usage: Storing the current score.
*/
static public var score:Int = 0;
/**
* Generic bucket for storing different <code>FlxSaves</code>.
* Especially useful for setting up multiple save slots.
*/
static public var saves:Array<FlxSave> = [];
/**
* Generic container for a <code>FlxSave</code>. You might want to
* consider assigning <code>FlxG._game._prefsSave</code> to this in
* your state if you want to use the same save flixel uses internally
*/
static public var save:FlxSave;
}