Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TheCheapestPixels/panda3d-stageflow
Abstraction for certain stages and sub-stages during a game's runtime lifecycle
https://github.com/TheCheapestPixels/panda3d-stageflow
Last synced: 3 months ago
JSON representation
Abstraction for certain stages and sub-stages during a game's runtime lifecycle
- Host: GitHub
- URL: https://github.com/TheCheapestPixels/panda3d-stageflow
- Owner: TheCheapestPixels
- License: bsd-3-clause
- Created: 2020-02-18T23:56:04.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-12T23:28:31.000Z (over 3 years ago)
- Last Synced: 2024-08-09T12:29:06.028Z (6 months ago)
- Language: Python
- Size: 1.23 MB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
panda3d-stageflow
=================Just about every game beyond gameplay prototypes goes through distinct
stages: Opening credits, main menu, main game loop, ingame credits, and
so on. These can be arranged as a finite state machine, with data being
passed between stages.In addition, each stage, especially the main menu and main game loop,
can have certain modes that modify their base functionality, mostly
menus that pause the base game; These are called substages.`stageflow` implements this basic framework, letting you...
* focus on each `Stage` and `Substage` separately,
* re-use `Substages` over several `Stages`,
* use premade typical `Stages` / `Substages`.For example: # FIXME: Abstract Panda3DSplash out of the example...
```python
from direct.showbase.ShowBase import ShowBasefrom stageflow import Flow
from stageflow.panda3d import Panda3DSplash
from stageflow.prefab import QuitShowBase()
base.flow = Flow(
stages=dict(
splash=Panda3DSplash(exit_stage='quit'),
quit=Quit(),
),
initial_stage='splash',
)
base.run()
```This example...
* creates a `Flow` with two stages (named `splashes` and `quit`),
* immediately enters the `splashes` stage, which creates a `Task`,
* starts Panda3D's main loop,
* lets the `Task` play the splash until it ends, or `escape` is pressed,
* transitions to `quit`, which in turn ends the program.Installation, etc.
------------------Installation: `pip install panda3d-stageflow`
Documentation: [readthedocs.io](https://panda3d-stageflow.readthedocs.io/)
Source and issue tracker: [GitHub](https://github.com/TheCheapestPixels/panda3d-stageflow)