Re: TIB: -Frank--1&2


[Prev][Next][Index][Thread]

Re: TIB: -Frank--1&2




One easy way to keep track of items would be to assign each one a number of digits
based on the item number: If you had 8 items you could get, item one would be 8
digits, Item 2 would be 7 digits, item 3 would be 6 digits, etc.  With this you
could then have one small real variable to contain your inventory.  For instance,
if you had items 1,4, and 8 with only 8 items you could have, the variable would
be 10010001.  You could have a simple routine to see if each item was there based
on the size of the number: example (with INV being the variable containing the
inventory):


Disp "Inventory:"
INV->TEMPINV
If TEMPINV>=10000000:Then:Disp "Item #1":TEMPINV-10000000->TEMPINV:End
If TEMPINV>=1000000:Then:Disp "Item #2":TEMPINV-1000000->TEMPINV:End
If TEMPINV>=100000:Then:Disp "Item #3":TEMPINV-100000->TEMPINV:End
If TEMPINV>=10000:Then:Disp "Item #4":TEMPINV-10000->TEMPINV:End
If TEMPINV>=1000:Then:Disp "Item #5":TEMPINV-1000->TEMPINV:End
If TEMPINV>=100:Then:Disp "Item #6":TEMPINV-100->TEMPINV:End
If TEMPINV>=10:Then:Disp "Item #7":TEMPINV-10->TEMPINV:End
If TEMPINV>=1:Then:Disp "Item #8":TEMPINV-1->TEMPINV:End

That's all I have to say about that.

-Peter

SWISH 97 wrote:

> hey about the money thing you guys helped me out with for my game with the
> U->200
> It worked great but I was wondering if there is a way to have something so it
> wont let them buy something if it will make them have  a negative balance?
> Also, if im not pushing on you guys is there a way to keep track of the items
> they have so like if they pick up an item they can go to a screen that
> displays all their items, and each item has a number maybe so when they pick
> it up it enters something like show-8  and then the item will be there,
> (remember TI-85)but they are all a lot a like, well thanx so much again and
> this is all i need to complete my game witch will be on a web page that i will
> give the address to when i finish, thanx again-Frank






Follow-Ups: References: