bevyengine / bevyengine/bevy

Improve state change example

Open
#4,123 0 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Examples
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

In the example for changing [state](https://github.com/bevyengine/bevy/blob/latest/examples/ecs/state.rs), it shows a great example how to which from state Menu to state InGame. However it is missing, how to deal with going back from the game, to the menu.

## What solution would you like?

I would propose an addition to the example, where pressing the escape key moves you back to the menu. Once back in the menu you've got two option:

- Continue the game where the player left off (meaning reentering the stage "InGame" with the already existing entities)
- Create a new game where it clears out the existing entities (like the first time loading the game)

## What alternative(s) have you considered?

The documentation on "stages" and/or "systemset" could be improved to explain a bit more what happens and is expected when SystemSet::on_enter(), SystemSet::on_update(), etc are triggered

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.