AztecGameLab / LongTermGame8

2 stars 1 forks source link

Level Transitions #41

Open poetahto opened 5 months ago

poetahto commented 5 months ago

The Task Allow the player to move through doors between different gameplay scenes.

Extra Info As we move away from a prototype into a more connected game, we need a way for the player to move between different scenes. For example, going inside a door and returning back outside.

The challenge here is that we need some way to link these doors across two different scenes. The simplest way is just through an integer or string ID on the door that names some door in the target scene. When the other scene is loaded, you search all doors for the one that matches your target ID, and move / rotate the player to there.

You'll probably want to create a new script to run this logic, and a demo of it using the Trigger prefab to call into it and move between some testing scenes.

Note: we use the additive scene workflow to keep the persistent scene always loaded, so don't call SceneManager.LoadScene directly! Instead, we wrap it with the following call: Ltg8.GameState.TransitionTo(new OverworldGameState(targetScenePath));. This should unload the current scene and load the new one. It is an async method, so you can await until it finishes and then search for the new scene door id.

(Justin's Additions)

Necessary Assignees

Programmer(s): Responsible for implementing the actual transition.

Level Design: Responsible for placing the scene transition trigger