Skip to main content
gamedev.net
🔒 Locked

Inventory system

Started by Patrick1382 Dec 27, 2002 at 5:20 PM 3 replies 300+ views
Original Post
Patrick1382
Patrick1382
I''m fairly new to programming and at the moment I''m workin on a simple text rpg type game. Right now I''m trying to make an inventory system although I''m not sure how I could do this. I''m trying to make an inventory system that is activated by maybe hitting "I" with around 20 slots for items and then depending on what the character has list those items and then maybe bringing up an info screen when the character selects the item with the option to use/equip/drop the item. Any help on this subject would be appreciated.
Muzlack
Muzlack
This is what I''d do..

  
typedef int item; //this will make inventory look a little cleaner..


enum {
Battleaxe=0,
BigSword,
Biggersword,
GiganticSword,
HolyWowThatsABigSword,
Potion
} ;
item inv[20];
int curitem=0;

void additem(item i) {
inv[curitem]=i;
curitem++;
}


Something like that..


--Muzlack
--Muzlack
Sneftel
Sneftel
Muzlack, if I were you I would reeeally consider changing your sig. That thing is freakin'' huge, and will annoy people.


Don''t listen to me. I''ve had too much coffee.
johnnie2
johnnie2
Mmm, didn''t annoy me. I certainly thought it was strange, almost made me click, but not enough to cause trouble. Of course you''ll have people come along claiming things like it''s too big, ''I don''t like to turn the mouse wheel a few extra times to actually scroll to the end of the page because it''s so laborious'', etc.

(btw, I believe the soul-evaluator images were larger than this, and many people sported them in their signatures whereas this is a very isolated case. Calm yourself.)

RapscallionGL - arriving soon.
____________"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.