Changing attributes value from scene to scene

Hello Gs community,
I'm making a puzzle game with more than one level.
I've created an integer attribute wich represents the total moves that the player can perform in one level. Now the problem is that once created the attribute and assigned it a value, i've found the same attribute and the same value in every scene that i create. In this game every level has it's own number of move, wich is different from level to level. How can i solve this problem?

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited November 2014

    You can create an actor called controlerMoves. Create a self integer attribute called levelMoves.

    Then place a change attribute in the logic stack, not wrapped in any rule so it'll fire as soon as the scene starts. Change game.Moves (your main attribute) to self.levelMoves.

    Then place the actor on each scene. Then double click the actor on the scene and manually change the self attribute and enter the number of moves you want for each scene.

    That should do it.

  • mikbiomikbio Member Posts: 54

    Thanks i'll try this out asap :)

Sign In or Register to comment.