
-----------------------------------
diablo
Tue Nov 09, 2004 10:21 am

displaying objects in arrays
-----------------------------------
1)i have an RPG game in the works,
but i don't know how to tell the program to display what is in the inventory array.
can you tell me?

2)also can you tell me, when i use "itemX" from inventory slot 1,how so that when i display the inventory again, slot 1 will be empty and i can buy in item to fill it up again.
so that when i buy "itemY" will fill up the next available slot.?

-----------------------------------
Tony
Tue Nov 09, 2004 10:30 am


-----------------------------------
run a forloop, 1 to inventory size, and display each element

-----------------------------------
diablo
Tue Nov 09, 2004 10:34 am


-----------------------------------
so if i have and inventory of 20 items(ex:slot 1=itemX, slot2=itemY,etc)
i have to run a FOR loop for each element?

-----------------------------------
Tony
Tue Nov 09, 2004 10:41 am


-----------------------------------
no

for slotID: 1..20
     display(item(slotID))
end for


where display is a function that atually does the displaying (whatever you code... like draw or something
