PDA

View Full Version : How do I keep track of Experience Points and Gold in a Flash 8 Game??


ScarletSniper
03-15-2008, 11:45 AM
Hi, everyone!!
Again, thanks for all your help on my game, and I really appreciate it. :)
I've got another question to ask, though. I'm creating a RPG, where the characters can battle monsters and if the characters win the battle, they gain experience and gold pieces. My question is that how can I keep track of a character's experience points and gold pieces in a Flash 8 game?? (What ActionScript 2.0 code do I use, since I'm a newbie and I've only used Flash in 4 weeks)
If anyone can help, I'd really appreciate it.

ScarletSniper

sebitaz_88
03-15-2008, 03:34 PM
.. you should set a numeric variable..
var myGold:Number = 0;
var myExp:Number = 0;...

and when you kill sth..
myGold += 10;// let's say..
myExp += .25;//don't know.. change this values...
you'll probably want to set to the "bad guys" movieclips.. which you must kill...
some properties like badGuy1.gold = 20; & badGuy1.exp = 1;
and then when you kill it... you just .. have sth like..
myGold += this["badGuy"+hisNum].gold
myExp += this["badGuy"+hisNum].exp

ScarletSniper
03-15-2008, 03:50 PM
Thanks for the advice, I'll try it and see what happens. If anyone else has a different way of doing this, feel free to let me know.

Thanks,
ScarletSniper

:)