> For the complete documentation index, see [llms.txt](https://vypxl.gitbook.io/scar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vypxl.gitbook.io/scar/application-structure/scenes.md).

# Scenes

Every scar app is organized in scene&#x73;**.** A scene is a container for [spaces](/scar/application-structure/spaces.md). It should contain everything that has to exist in one single game scene. For instance, there could be a splashscreen scene, a main menu scene and a gameplay scene.

Scenes can be created with [spaces](/scar/application-structure/spaces.md) as parameters or without without them. `<<` and `pop` can then be used afterwards to add or remove them, `[]` or `[]?` or `spaces` to get specific spaces. Calling `update` and `render` are handled by the [App](/scar/application-structure/app.md) containing the scene.

The scenes are managed by the `App` scene stack. You can access it via `App#<<`, `App#pop`, or the `scene_stack` getter. `App#scene` returns the topmost scene for convenient access. Only the scene on top of the scene stack gets updated and rendered.

Because of the stack structure, scenes can be inserted one after another and afterwards pop'ed off the stack. This can be used to e. g. show a main menu scene, then start the gameplay scene and then popping it to see the menu again. Scenes on the stack are not deleted until they are popped.

An example can be found in the [next section](/scar/application-structure/spaces.md).
