Change Scene Behavior - Bug !?
I saw a nice function in FreeCoverFlow by @Tshirtbooth that he had the buttons sending the preferred level selection to a game attribute and then load a default scene from where (my guess is) the levels were loaded....I tried to make a simple version of that function in the example bellow but for some weird reason Change Scene behavior isnt working.
Can someone please take a look at the project below. It a simple version of what i am facing.
The 2nd scene does grab the game attribute the user selected, but it wont change the scene to the preferred number. Its really weird.
Thanks
http://www.mediafire.com/?a39a8e6lvg5g5ln
Can someone please take a look at the project below. It a simple version of what i am facing.
The 2nd scene does grab the game attribute the user selected, but it wont change the scene to the preferred number. Its really weird.
Thanks
http://www.mediafire.com/?a39a8e6lvg5g5ln
Comments
If you have a " preferred level selection" attribute , then simply in your button make a rule-
Touch is pressed:
If "game.preferred level selection" = 1
go to scene 1
If "game.preferred level selection" = 2
go to scene 2
If "game.preferred level selection" = 3
go to scene 3
And on and on .
Cheers.
Roy.
You are holding the "selected level" in a variable and all buttons have goto scene 1.
I thought that in that scene you'd grab the variable and do the magic switch. (made sense to me since we do stuff like that with PHP all the time :P).
This way instead of editing every button you have them all go to the same place sending the game variable as well...its like saying: /scene.php?lvl=2
But, i understand what you guys are saying...i just tried to be all Object Oriented on it :P
But how come this is not working anyways ?
The 2nd scene has the value at hand, and i just do a Rule check and forward the user to the other lvl. Why is it getting stuck there?
Timer - after 0.1 sec
Game.lvlvselect = 2
go to scene 2
Roy.
Putting a timer delays the behavior until everything is loaded properly.
Thanks