Changing scenes with an attribute
So I'm working on a level select menu. My game has 10 worlds of 15 levels each.
The level select menu has 15 buttons - one for each level in a world. Each button has an attribute called self.buttonNumber, which start at 1 - 15 respectively.
There are also buttons to increase the world up and down. When the world is increased each button's self.buttonNumber increases by 15. So in world 1 they span from buttonNumber 1 to 15, and in world 2 they span from 16 to 30, and so on.
I intended to have a rule 'when touch is pressed - change scene to (self.buttonNumber).
However I've just realised that the change scene behaviour doesn't have access to an expression editor.
I really don't want to have 50 rules:
'if touch is pressed and self.buttonNumber=1 change scene to scene1
if touch is pressed and self.buttonNumber=2 change scene to scene2
...
if touch is pressed and selfbuttonNumber=150 change scene to scene150'
as this would be crazy.
Does anyone have a better idea for changing to a level based on the self attribute of the actor that is calling the scene change? Or a completely different idea that might work?
Thanks in advance!
The level select menu has 15 buttons - one for each level in a world. Each button has an attribute called self.buttonNumber, which start at 1 - 15 respectively.
There are also buttons to increase the world up and down. When the world is increased each button's self.buttonNumber increases by 15. So in world 1 they span from buttonNumber 1 to 15, and in world 2 they span from 16 to 30, and so on.
I intended to have a rule 'when touch is pressed - change scene to (self.buttonNumber).
However I've just realised that the change scene behaviour doesn't have access to an expression editor.
I really don't want to have 50 rules:
'if touch is pressed and self.buttonNumber=1 change scene to scene1
if touch is pressed and self.buttonNumber=2 change scene to scene2
...
if touch is pressed and selfbuttonNumber=150 change scene to scene150'
as this would be crazy.
Does anyone have a better idea for changing to a level based on the self attribute of the actor that is calling the scene change? Or a completely different idea that might work?
Thanks in advance!
Comments
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx