Storing levels and current level

85 views
Skip to first unread message

ohblahitsme

unread,
Apr 6, 2014, 2:47:56 PM4/6/14
to haxef...@googlegroups.com
Hi all,

I'm wondering how you guys usually store levels and save the current level of the player?

For example, do you create a new FlxState for each level? Do you use the registry to store levels? How do you store level select screens?
I was thinking of creating a new FlxState for each level and store them in the registry, along with the current level. Then I can use FlxSave to store the current level persistently.

What schemes do you use?

Alex Pires

unread,
Apr 7, 2014, 3:12:27 PM4/7/14
to haxef...@googlegroups.com
HI!

I think it's better create a map for each level instead making many .hx FlxState files. Creating one FlxState to read the current map and load what is necessary for each level.

The template you create using flixel tpl -n yourGameName provide a file named "Reg.hx" that you can use it for store the levels and Score among other info. Open it to see how it works.

Plus, you can use flixel.util.FlxSave to save game information like "cookies".

Help this can help you and sorry about my english.  ( :
 
Reply all
Reply to author
Forward
0 new messages