Hi guys,
I'm having some problems here.
I have a level selector, let's like it's Angry Birds-like (you can't play level 2 unless you have completed level 1), and I'm having some problems here...
I don't know if I'm doing it correctly or not, but this is the way that came to me.
In my level selection layout, I have two sprite-buttons, one of the is level one, the other is level two.
You can play level one (green colour), but level two is disabled (gray).
I've tried to do it in two ways:
Having an active variable for each button, so I enable it when it's true.
Having an external object, which stores local variables, basically the same.
So, I also have a level one layout, level one eventsheet, and level one HUD eventsheet. The relevant one here is the HUD sheet. There, I count how many enemies are in the level, and if I destroy them, this number decreases, so when it reaches 0, the level ends (level completed).
When the level ends, I make a recount of the points earned for destroying enemies, and I switch the level 2 active variable from my level selection layout to enabled.
What happens is that I guess it doesn't really enable it, as my level 2 doesn't turn green as it should.
Also, my global var "total score" (points which will be used in an in-game shop), goes crazy when I try to add my level earned points to it, as it seems it doesn't stop adding them, and my total score var goes on increasing.
Could anyone help me with these matters?
Thanks in advanced, and sorry for the long post.