change character bwtween scenes


  • Posts: 21
I managed to find a way to change between two characters with some help, but now I need to make it so I can change player between scenes.

It need to:

1) remember the exact coordinate in space of both players,
2) detect in which scenes the player I am not currently controlling is located
3) return to that scene when a button is pressed
4) and of course, the game must keep in memory every action that was performed before loading back
the scene where the other character is located (switch that was set on, items previously found, etc)

Is there a way to do this or must I create an extremely large scene in which I would simulate a scene change by fading to black the screen while I change my player's coordinate on the same scene.... would be quite bothersome since I would have to keep the same background all the time...

I looked around, but I haven't found a way to implement this yet. I have almost completed the mechanic for my game, but I still need this one little thing ;)


  • *
  • Posts: 2545
If it were me this is what I would do.

1. Create two global lists
2. For each of them store the: xposition, yposition, scene they are in, Items collected (quantity and whether unlocked)and any other things you may need.
3. In the scene create an event that when the scene is created, create a player actor at the given position (drawing info from the global list).
4. When the scene is switched, to do this you store the current info in the second list and switch to the scene given in the first list.

(sorry if this seems a bit hard to understand, just tell me and I will reword it.)