CHANGE SCENE

hi,
i want to create a actor, which when pressed continues ended game from the last scene player was playing.
but can't find any help or code.
the 'switch to scene' palette can only switch to a given scene.

please help.

« Last Edit: August 07, 2014, 02:13:01 pm by simpledevelopers »

HEY

I REALLY NEED HELP ON THIS PLEASE!!!

sdieters

  • Posts: 2068
http://community.stencyl.com/index.php/topic,12.0.html << rule number 3. very usefull to read.

your question is vague so allot of people don't have a clue about what you are talking about, including me.
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

Indigo

  • Posts: 23
Ummm your question is rather vague but i'll give it a shot... so do you mean you want a "continue saved game" sort of button like they close the game then can open it and keep going from the same place?

In that case you need to make a set of game attributes (the purple ones, not the blue ones) for score, location, health,  anything else you want to persist between plays. Then, every so often maybe every minute or every time actor reaches a checkpoint or changes scenes, use the "save game and then" block, (you can leave the inside of the loop blank).

Now, to reload, you will want to have a continue button and perhaps a new game button. For the continue button you will have a "when pressed" even then inside that put the "load save file and then" loop and then switch to the scene as specified by your saved attribute.
For a new game, simply set all game attributes to their starting value (zero or whatever) and switch to the starting scene.

This has some more info http://www.stencyl.com/help/view/game-attributes/ and http://www.stencyl.com/help/view/saving-and-loading-games/

Hopefully that helps :)

oh no problem dude i got my answer.
thanks for helping anyways :)

krazziebone02

  • Posts: 113
sir i have problem

i have a game and it is just like the candy crush game

so i want to ask is......for example the actor touches the level 1 then switch scene and after that you are on the game......and after you finish the game you are on level 2
but my problem is when i finish the level 1 and then when go back to the scene where you will select your level.......the actor is  back to the normal position and when the actor will touches again the level 1 it will just load the scene for level 1

i want to know how to remain the original position of the actor while you are playing the level 1

i want to be the best user of stencyl

sdieters

  • Posts: 2068
save it in a game attribute =)
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

krazziebone02

  • Posts: 113
what code should i put??

is it in when updating?? drawing?? creating?? etc.....
i want to be the best user of stencyl

sdieters

  • Posts: 2068
whenever you press the button to play, first save the position of that actor to a GA, then switch scenes. the next time you go back to the level select scene, move your actor to the position of the GA
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

krazziebone02

  • Posts: 113
i have a code that when the actor(my character) touches the other actor (for levels) then switch the scene is it right code for that??
i want to be the best user of stencyl

sdieters

  • Posts: 2068
yes, but the best way is to create your actor at runtime at the desired location rather then moving it
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p

krazziebone02

  • Posts: 113
do you have some screenshots for that sir??? i am really newbie sir

try to give me an example for that can you??
i want to be the best user of stencyl

krazziebone02

  • Posts: 113
sir i hope you will give me some example for that thank you very much
i want to be the best user of stencyl

sdieters

  • Posts: 2068
iff you send me the project file i will make a video about it if you like. all your own code will be kept secret.
this saves me lots of time.

let me know
My new profile is TheIndieStation.
When you see a recent post with this name, i'm probably using my phone. So dont mind any typo's =p