Ok, I've currently gotten stuck on a part of my inventory system. Ok lets say I have 50 variables:
Item1 = 1
Item2 = 2
Item3 = 3
Item4 = 6
Item5 = 7
Item6 = O
.... on to Item50 = 0 The values don't really matter.
Ok now lets say each one is assigned a sprite that corispondes to its number. Like:
Rem == Sprite for Item1
Sprite 1 , Item1x, Item1y, 1
Ok Once I put my cursor over the sprite I search for collisions like this:
MX = MouseX()
MY = MouseY()
MouseInput = MouseClick()
Temp_Number = 1
If MouseInput = 1
FOR Temp_Number =1 TO 54 STEP 1
SpriteCollision = SPRITE COLLISION( 95, Temp_Number)
If SpriteCollision = 1
Item_Activated_n_ = Temp_Number
Goto ItemSelected
EndIf
Next Temp_Number
EndIF
Were Item_Activated_n_ equals the number of the item I clicked. Because the Sprite number and the Item(Number) are the same. Ok after I've moved the sprite where I want it,
how could I Change the value of the activated Item(what ever it may be) without have to do something of this sort:
If Item_Activated_n_ = 1
Item1= "Whatever"
EndIF
If Item_Activated_n_ = 2
Item2= "Whatever"
Endif
If Item_Activated_N_ = 3
Item3 = "Whatever"
Endif
on and on to ...
If Item_Activated_n_ = 50
Item50 = "Whatever"
? Is there a shortway than the way I have write above? I know DBP is full of wonderfully powerful code, however I'm not that familiar with the language(not programming...the language). Could someone help? Sorry if this wasnt clear enough.
"Laugh to scorn the power of man..."