0 Favourites

Check Instance Variable for Each Unique Item???

  • Hello, I need a suggestion on this

    I was planning to make a function which would change the animation/state of the sprite depending on an instance variable specified. Also it should still be saved when I leave the layout.

    For example

    If the instance variable of the sprite is 1, then its visible. On the other hand if it's 0 then it's not. Then there are many instances of the object on the layout.

    Is there any way to do that, while saving everything when I leave the layout? Oh and also, a variable from another layout changes the state of the object in the previous.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I don't understand why you need a function. If the player can move between layouts, the sprites values remain the same. Like an RPG where the player moves between rooms. What ever set of conditions you use to change their variable, the variable remain the same, when returning to the layout. Make sure the sprites are set to global in the properties.

    However once the layout is changed, you'll be operating from a different event sheet. You can't effect the variables because they are not global. So use a single event sheet for both layouts.

    Make sure you "Groups" to nest your code in. This way you can disable or enable a group to avoid conflicts, depending which layout the Player is on.

    Hope that helps.

    http://www.neoprofessor.com

    http://www.nakedgametalk.com

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)