[Solved] Player position after scene change?

Good morning I’m making some mini games and I would like to know when the player moves from scene 1 to scene 2 and then from scene 2 to scene 1 how can I have the same position near the yellow door even if the player starts very far from it from the scene 1

Write two global variables Player X and Player Y Pos.
After a scene change, you move the player to this values

if have a lot more doors / ways etc. you need a more complex system, but anyway u store the last pos or just x and y is very close to the point u want the player to be.

what also maybe helps, create one global var for each door/way you have and when its used you toogle a boolean for an easier way back

Here an example for a way in a door and the second screenshot, the way back

Hi thanks, could you kindly explain it to me more easily maybe scene by scene if it’s possible I’m new to creating small games

:grin:

Thanks friend I succeeded thanks again :smile:

1 Like

what about the fade in fade out?

withn the function of positions

Anyway where you can find global variable? Sorry if i annoy you all

Hi, this tutorial can help you.

Global variables are found under the game settings where you open the bar to create a scene

globa

so i tried this code after meking fade in fade out code and it did not really work. Do you know why this is happening?


In scenes A and B you can insert a sprite of whatever color you prefer that covers the entire scenario screen and in the events of scenario A insert
(Condition)
At the beginning of the scene
(Action)
opacity of the sprite covering the screen set it to 0
(Action)
When Sprite collides with the Sprite Opacity Door covering the screen is equal to TimeDelta*80
Second event
(Condition)
When opacity of sprite covering the screen is greater than or equal to 255
(Action)
Change the scene to Scene B
and the same thing goes for scenario B

Scena 1

Scena 2

You need to create a sprite that covers the screen also called Fade and use this scheme in both Scenario A and Scenario B.

I meant player position after scene change

Follow the diagram I sent you earlier, the one with the green square and the yellow door.

Scena A


Scena B