how to make a "go to next scene" button
future_games_101
Member Posts: 58
on my app, it's based on levels. So once you beat my level, I have a scene that comes up, and on the scene I want to put my "go to next scene" button. But, it will only go to the next scene I have lined it up with in my scene selector. And if possible, I would like to avoid making a scene in between every level. If anyone would help me, I would really appreciate it. Thx.
Best Answer
-
CodeMonkey Posts: 1,803What you can do is have a boolean game attribute that when true it activates the Change Scene behavior to go to the next scene. The pause screen that you bring up when you beat a level, when you press the next level button it changes the game attribute to true and unpauses the game, returning you back to the current level. To make sure you don't leave the next scene as soon as you get there, put the Change Scene into a Timer that will run to completion after a very small delay. Outside of and after the Timer, change the game boolean back to false.
The Button in the Paused Scene:
Rule If touch is Pressed
--Change Attribute game.GoToNextScene = true
--Unpause Game
In a control actor in any of the level scenes.
Rule: If game.GoToNextScene == true
--Timer After .01 Run To Completion
----Change Scene -> Next Scene
--Change Attribute game.GoToNextScene = false
Answers
1. Menu
2. Level 1
3. Level 2
4. Level 3
On each scene, you would have a button with the rule: When Touch is Pressed --> Change Scene [next scene].
So how is your setup different from that?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
1.menu
2.level 1
3.level 2
4.level 3
5.pause scene( go to next scene)
ok so on the pause scene (when you press the pause button(which is on every level)) It has a home button, a "reset scene" button, and a "go to next scene" button. and I am having trouble with the "reset scene" button and the "go to next scene" button. because when I press the reset scene button it only resets the pause scene. and when I press the "go to next scene" button it only goes to the scene that is after the pause scene. which in this case would be the menu scene
cheers
In each scene have change attribute at start.
Change attribute: game.level to 1,2 0r what the level number is. By using only one attribute it will overwrite for each level and you will never have a conflict as to what level is active.
Rule for leaving pause.
When touch is pressed
Rule inside the touch is pressed rule.
When game.level = 1
Change scene to level 1
OTHERWISE
Rule
When game.level = 2
Change scene to level 2
OTHERWISE
Rule
When game.level = 3
Change scene to level 3
Keep adding rules like this in each otherwise section.
If you want the scene to reset like play again it's best to have a pop up at the end of a level failure to ask "Try Again" or something like that and do a when touch is pressed reset the active scene. Going to a pause menu then to a reset scene is not advisable as pause means pause current action. Have the reset in the active scene and give the player the option to either replay or quit to the main menu.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx