by DollMaster » Tue Nov 06, 2007 2:26 am
Inventory is actually the next thing i am going to make. A simple way to do that...
1)item actor. lets say an axe. when you collide with the axe you pick it up. so there will be a variable, axe=1.
2)on the inventory screen. there will be a spot. if axe=1, then there will be an axe image in that spot.
The way I am going to do it...
Stage1
variables for inventorymode, inventorycursor, inventorycursor2, equippedweapon, inventslot1, inventslot2, inventslot3, etc...
a list of values which identify what item they represent, ie 1=axe, 2=sword, 3=candle You should make some numbering conventions maybe. 1-20 weapons, 21-40 armors...this way itll make it easier for you later on.
Stage2
Create actors. When you collide with an item actor, you pick it up.
ie. You walk over an axe. Inventslot1=1. You walk over a candle, inventslot2=3.
Stage3
When you press button to go into inventory, inventorymode=1 and view shifts to inventory.
Stage4
Depending on the values for each inventslot, an image will appear reflecting it. When you are in inventory mode, inventorycursor=1. Reflecting the initial spot that the cursor is at.
Stage5
When you press the arrow keys the inventory spot will change, and thus the value of inventorycursor. Also, inventorycursor2=invenslotn. Which will equip the item in inventory.
Stage6
Add functionality to each inventory item.
Stage7 - Shop
This will be diffulcult, but basically itll be code that will fill up your inventory slots without you colliding with things.
Stage8 - Bank
I want someplace to store items when slots are filled.
And that is the route I am going to take. Unless anyone has anything to add follow this route and we will learn together.