Level overview with more than one screen, change camera, coming back from level
MarcoCol
Member, PRO Posts: 279
I have a level overview with 8 level icons per page. If the player want to see the next eight, which are on the next page, he must push a button. The button has the function to interpolate the "scene.Camera.Origin.X".
That works pretty good.
But when the player finish a level and came back to the level overview, he see the levels 1-8. That is ok, if he played one of those. But it is not good, if he come back from a higher level.
How can I set the screen/function right?
That works pretty good.
But when the player finish a level and came back to the level overview, he see the levels 1-8. That is ok, if he played one of those. But it is not good, if he come back from a higher level.
How can I set the screen/function right?
Comments
So essentially, when the player leaves a level, record that level number in an attribute, let's call it 'lastLevel'.
Then when the level overview loads, have rules that say:
if attribute(lastLevel)<=8 {set camera origin x to (whatever it needs to be for page 1)}
if attribute(lastLevel)>8 & <=16 {set camera origin x to (whatever it needs to be for page 2)}
etc...