The Daily Click ::. Downloads ::. Tutorial ::. Inventory Example using List Object
 

Inventory Example using List Object
Author: Chris Burrows Submitted: 6th April, 2011 Favourites:0
Genre: Tutorial Downloads: 414
Rated:


Edited By Chris Burrows on 3/9/2012

Edited By Chris Burrows on 3/9/2012

This is an example of how to create an inventory system using the List Object.

The list object is a horrible object, but it may suit your needs.

When you delete a line from a list object, all lines below it move up, thus there is no empty slot in the middle of your inventory. Nice and easy.

I have made a much better inventory example using the array object here:

http://www.create-games.com/download.asp?id=8528


Review This Download



 


http://www.whenthereisnoroominhellthedeadwalktheearth.com/MMF/inventoryexample.mfa (423kb )



Posted by Chris Burrows 7th April, 2011

FIXED! I had to remake it from scratch. It is better now though. Hope you like it.
 
Posted by Disthron 7th April, 2011
Rated :

Very good example. I thought it was clever how you used the qualifyers. You also coverd most bases in terms of the inventory system. I think the only thing not coverd is what happens if there are more items than you have slots for.

But still a grate example.
 
Posted by the Pilgrim 7th April, 2011
Rated :

Fine example of how you can have an excelent inventory routine, for ex. in an Adventure or RPG.
 
Posted by Chris Burrows 8th April, 2011

If you only have 4 inventory slots, then whenever you pick up an item you make it check if the 4th line in the list is equal to "", aka nothing. If the 4th line is empty then it means you have room.

I didn't want to have too much confusing code but I guess it would have probably been good to add it.

Thanks a lot for your kind words!

 

 



Author

Favourite



Advertisement

Worth A Click