Changing scenes with an attribute

BarrytheBraveBarrytheBrave Member Posts: 134
edited August 2012 in Working with GS (Mac)
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!

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Hmm..None that I can think of...I really do wish that behavior would have the ability to connect to the expression editor.
  • BarrytheBraveBarrytheBrave Member Posts: 134
    Cheers. I have no problem with adding loads of rules if that's the only way to do it, except I'm guessing it's going to add to load times quite a bit?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Yeah, I think it will...On Frozen Finder I had to put rule inside rule for how many letters were selected..But I only had a max of 12 rules...
Sign In or Register to comment.