How do you simulate money?

Started by piraatlife4me, Mon 24/11/2003 16:13:43

Previous topic - Next topic

piraatlife4me

Hey I have been stumped and need some help?  My game has a room in it with arcade machines and interactions with the game machines.  I want the player to have money and a special GUI to appear only when the money inventory item is changed as the pointer cursor or when the player looks at the inventory item in the inventory panel.  I created the GUI and it is GUI#4.  I already have three labels on it one that just says money, another that is has a $, and the third is a label reading 0.00 this where I want the actual amount of money the player has to go.  How do I set this up so there is a starting amount of money but when a player plays a game it will subtract from the total amd display it in the GUI.  Also I want the GUI to disappear whe the player chooses a different item or a different command all together.  So the GUI is only displayed when the player interacts with the money icon only.  And I also want it to work in everyroom as well in case I want to use money again in a different situation.  Another question I had is does anyone know if there is a way to run non ags game inside a ags game? Say the player interacts with a game machine and I wanted frogger or dig dug to run iside my game Is this possible?  I know you can play an AGS game inside a AGS game but I wasn't sure if you could play non-AGS games as well?  Well if anyone out there in AGS land knows a solution to this problem please let me know!
thanks again!
Daniel
Winebarger

Pumaman

Well, you could have two variables, something like:

int dollars, cents;

then to set the label you could have this in repeatedly_execute:

string temp;
StrFormat("%d.%02d", dollars, cents);
SetLabelText(GUI, OBJECTNUM, temp);

when they spend money just take it off the variables, when they gain it you add it on.

SMF spam blocked by CleanTalk