Next Level Button

Jovial Games

  • Posts: 132
Hey guys,

I'm making a level based game but the problem I'm running into is that when the level completes, a pop up shows up for the next level you need to click the button. Now here's the issue, I'll need to make 65 next level buttons for each level direction, can't I just make ONE next level button and just assign the scene for each pop up?


Thanks!

merrak

  • *
  • Posts: 2737
You can use the inspector in the scene editor to customize values for an actor behavior for one specific actor.

If it were me, even that would be too much of a hassle so I'd do this instead: First, name your scenes "Level 1", "Level 2", etc... something consistent. For your button, take the name of the scene and use the 'split text' block to split the scene name into two words. The second word will be the number. Convert the second word to a number attribute (in my example to follow it's called 'level'), add one to it, then go to scene "Level " + (level+1).

Example--
Code: [Select]
Set list L to "split scene name as text" into words
level = L[1] as number
increment level by 1
Go to scene "Level " & level  // note the space after the word "Level " inside the quotes

Jovial Games

  • Posts: 132
Lol, thank you for this but I can barely understand what's going on..

cabinfever

  • Posts: 159
I created an event, in which I check to which level to change next. Like this.
(my levels are named like: level_xxx , in which the numbers go from 000 to 999 )