Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a guide about the GOM #716

Open
wants to merge 4 commits into
base: canon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/discussion/gom.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/discussion/gom.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
=============
The Game Tree
=============

Games in PursuedPyBear organize their objects into a tree, with the
:class:`.GameEngine` as the root, and then :class:`.System` and :class:`.Scene`, and
then :class:`.Sprite`.

.. figure:: gom.drawio.svg


Game Objects
============

All of these are instances of :class:`.GameObject`, which manages things like
tree operations and children searching and such.

Other than the :class:`.GameEngine` and its direct children, you may structure the
tree however you want. You can define your own game objects and put them in your
scenes (they won't render, but they'll receive events).


Event Dispatch
==============

Events are dispatched breadth first: top to bottom, starting from the
:class:`.GameEngine`, and then all of the :class:`.System` instances, and then the
:class:`.Scene`, and then their children.

In the above diagram, events would be dispatched in the following order:

1. Engine
2. System
3. System
4. System
5. Scene
6. Sprite
7. Sprite
8. Sprite
1 change: 1 addition & 0 deletions docs/discussion/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ advanced users.

values/index
assets
gom
maintenance-schedules
default-branch