~extremepopcorn/dhlib/dhlib_ep

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
The game structure has the following components.

Layout : The master controller (TODO: choose better name, separate logic/layout)

MapData : The active game data
MapBackground : A rendered for the game data

Panels : Control specific modes of the game, both layout and logic combined

Game events are posted to the gameEvents queue using the AsyncEvent tool to either post them asynchronously or directly.  These events are posted as things happen in the game data.  They should only be used for items that don't need to happen immediately and can undergo a short delay.

The panels are however the major driver for game modes, each panel is a specific mode and it will decide when that mode is over -- though the Layout then decides which mode comes next (allowing the Layout to control ordering in *special* games)

MapData has no rendering data and insteads dispatches messages when something changes visually (either the background or a live object).

Note that not all objects know about the gameEvents queue and thus will post their events to themselves like a normal Flash widget.  This means that several event listeners need to exist on the Stage, as it is the only place where some events will bubble to.  To simplify this the gameEvents queue is actually the stage queue at this time.