Page 1 of 1

I need some help... :(

PostPosted: Mon Feb 20, 2012 9:25 pm
by RippeR7420
So, I have a problem with my players Lives. I have it set to when you start the game, the player has 3 lives. and if you die, you lose one(Obviously).
I have it set to if you lose all your lives(Lives.textNumber=0), it will load the GameOver.dat file. And then takes you back to the title screen. but my
problem is, when you start the game again, you still have 0 lives?? I know this is because it's a global variable, and I am using LoadVars and SaveVars,
but I have no idea how to fix this.. I need the variable in the first level, because I have it set that if you die and, (Lives.textNumber >= 1) it reloads the
level and minus's a life.. Any help would be GREATLY appreciated.. :)

Thanks again for looking :D

Re: I need some help... :(

PostPosted: Mon Feb 20, 2012 9:44 pm
by RippeR7420
So, I think I just have to do it with MoveTo... and just have the variable transfer at the end of the level maybe?

Re: I need some help... :(

PostPosted: Mon Feb 20, 2012 10:06 pm
by Fojam
the problem is, your saving the variable as zero, and its loading the fact that its saved as zero when you start the game. what you should probably do is when the titlescreen appears, you should set player lives to 3, then use saveVars to save it

Re: I need some help... :(

PostPosted: Tue Feb 21, 2012 2:04 am
by RippeR7420
Thanks for the advice Fojam :)
but what I ended up doing was only making it save when I finished the level. Used Lives.textNumber = Lives.textNumber -1; and had it load the GameOver.dat
file if the lives reached 0.

Re: I need some help... :(

PostPosted: Tue Apr 10, 2012 11:41 am
by Antxion
if your still using move to you should probably change that to a separate game, easier saves and space :D