Points as money???

Started by Akumayo, Sun 29/02/2004 18:56:38

Previous topic - Next topic

Akumayo

I need to use points for money, like this:
Say you have 3 points, this is displayed as You Have 3 Dollars.  Then you go to the store and buy something:

GiveScore(-2);
AddInventory(4);

This works fine, you are reduced to 1 dollar.  However, if you buy it again you are reduced to -1 dollars.  How can I make it so that you can't buy the item if you don't have enough money???
(I really don't want to use variables for this)
"Power is not a means - it is an end."

Pumaman

if (game.score >= 2) {
 GiveScore(-2);
 AddInventory(4);
}
else {
 Display("You can't afford it");
}

Akumayo in Office Mode

But won't that code make it so that you have to have 2 dollars.  Like, if you had four dollars, would it still let you buy???

Gilbert

Yes, notice how CJ used ">=" instead of "==".

SMF spam blocked by CleanTalk