GameSalad is Rajjing my Skull
mynameisace
Hull, UKMember Posts: 2,484
Alright,
Trying to create an inventory on GS and GS is making me want to commit suicide.
What I need to do is make a few instances, first is that the item is not in the inventory, then the item is in the inventory, then the item is highlighted to be used, then it's seeyalater'd.
I have it so that I have my inventory checking for the attribute GotCigs to be true. When that's true it spawns the cigarette picture in the inventory at the bottom of the screen. Then when you tap on it, it changes to the highlighted version and everybody can't believe their luck.
Now comes the danger... When I tap another item in the inventory, I want the cigarettes to un-highlight and then highlight the current thing. I got this sorted but if an item is highlighted and you switch to a different scene, you cannot highlight any of the items in the inventory anymore
Any help will be deece, cheers
Ace
Trying to create an inventory on GS and GS is making me want to commit suicide.
What I need to do is make a few instances, first is that the item is not in the inventory, then the item is in the inventory, then the item is highlighted to be used, then it's seeyalater'd.
I have it so that I have my inventory checking for the attribute GotCigs to be true. When that's true it spawns the cigarette picture in the inventory at the bottom of the screen. Then when you tap on it, it changes to the highlighted version and everybody can't believe their luck.
Now comes the danger... When I tap another item in the inventory, I want the cigarettes to un-highlight and then highlight the current thing. I got this sorted but if an item is highlighted and you switch to a different scene, you cannot highlight any of the items in the inventory anymore
Any help will be deece, cheers
Ace
Comments
So you could have a integer game attribute for each item. game.CigState
Then have rules for when you have no cigs
Rule when game.CigState = 0
change self.color.alpha to 0
OTHERWISE
change self.color.alpha to 1
A rule for when you have cigs and not selected
Rule - when game.CigState = 1
------change image to CigsNoHighLight.png
------Rule when touch is pressed change game.CigState to 2
(no need to mess with alpha as the first rule took care of that in the otherwise)
A rule for when it is highlighted
Rule when game.CigState = 2
change image to CigsHighlighted.png
Then a rule in the actor that gets the cigs that says
When game.CigState = 2
do blah blah blah
I would also do saves and loads for the item states so that everything is still there when you quit the game and come back