Small Game in Dream Spark (Continued)

I know how sketchy I am at getting to this posts in time.  The thing is that I have a life unfortunately, and I will promptly continue having one.

I got a few minutes today to play with my game.  I checked out the inventory system, which is where I know a majority of my time will be spent over the next few hours of coding.  I know how I want to make it, where you can cycle through, but getting it to display the object in your inventory based on the type of item vs just showing the entire inventory will require each item to have another variable.  I expected a hurdle like this, but it is easier said than done in this case.  I know that each of the 4 inventories will have a finite amount of spaces, and by that I mean, it wont be unlimited numbers, but listed based on the number of a certain type of item you have in your inventory.

So you have 4 types, each item can have a line of code on it determining the type which can, after you pick up the item to your inventory, change a variable in an array… crap no arrays, so it will have to be inside of the object.  The variable would have to set itself.

Ok, so you walk up to an item and bump it.  Upon bumping it, the item itself transfers itself into your inventory.  Once in your inventory, it stays there dormant until you press the up arrow on the dpad.  It will by default show the first item in your inventory which is of that type.  To do this it can loop through items until it finds one with that type.  If it reaches the end of inventory before finding one, it displays a red x or something to indicate no items.

I have to find a way around variable scope because a variable in an object is by default hidden.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s