Inventory help needed!

Perfect Acorn Games!Perfect Acorn Games! Member Posts: 5
edited July 2012 in Working with GS (Mac)
I'm making a game where you pick up certain items and put it in an inventory. But I need to figure out how to do it. Also, I need to be able to carry the items around each scene, because you can go back and forth.

Comments

  • iCreationZiCreationZ Member Posts: 158
    The way I'd do it is for each item that you want to be a collectable, give a Game Attribute (Boolean), and name each one after the item, such as "game.StarCollected". Then when a certain event is triggered, change this to true.

    For instance, if you want the player to tap the star to collect it, give the Star actor a rule that states, when touch is pressed, change attribute game.StarCollected to true, as well as a rule such as, when game.StarCollected = true, destroy, (so that they can't interact with it further).

    Then on the inventory page or actor etc, put a copy of the star, and a rule that says, when game.StarCollected = true, change self alpha to 1. Basically, I'd just put all of the items in the inventory section, but only make them visable and interactable when they have been collected.

    Personally, I'd make the inventory into a separate scene and then to access it, I'd use the pause behaviour.
Sign In or Register to comment.