diff options
Diffstat (limited to 'img')
| -rw-r--r-- | img/event-sequence.puml | 16 | ||||
| -rw-r--r-- | img/event-uml.drawio.png | bin | 0 -> 217362 bytes | |||
| -rw-r--r-- | img/gameloop-class.puml | 37 | ||||
| -rw-r--r-- | img/gameloop-flow.puml | 26 | 
4 files changed, 79 insertions, 0 deletions
diff --git a/img/event-sequence.puml b/img/event-sequence.puml new file mode 100644 index 0000000..2555f33 --- /dev/null +++ b/img/event-sequence.puml @@ -0,0 +1,16 @@ +@startuml +skinparam SequenceParticipantPadding 15 + + +participant EventHandler +participant Publisher +participant EventManager + +EventHandler -> EventManager : Subscribe event +Publisher -> EventManager : trigger event + +EventManager -> EventHandler : execute callback function +Publisher -> EventManager : Queue Event +EventManager -> EventHandler : dispatching queued events +EventHandler -> EventManager : unsubscribe event +@enduml diff --git a/img/event-uml.drawio.png b/img/event-uml.drawio.png Binary files differnew file mode 100644 index 0000000..9eab458 --- /dev/null +++ b/img/event-uml.drawio.png diff --git a/img/gameloop-class.puml b/img/gameloop-class.puml new file mode 100644 index 0000000..e66b7d8 --- /dev/null +++ b/img/gameloop-class.puml @@ -0,0 +1,37 @@ +@startuml +!include theme.ipuml +class LoopManager { +	+static LoopManager& getInstance() + +	+void loop() +	+void setup() +	-void render() +	-void processInput() +	-void fixedUpdate() +	-void update() +	-bool gameRunning +	-LoopManager() +} + +class LoopTimer { +	+static LoopTimer& getInstance() +	+void start() +	+void update() +	+float getLag() +	+float getFixedDeltaTime() +	+void advanceFixedUpdate() +	+void enforceFrameRate() +	+float getDeltaTime() +	-float lag +	-float fixedDeltaTime +	-float deltaTime +} + +LoopManager --> LoopTimer : uses +LoopManager : loop() +LoopManager : |-- processInput() +LoopManager : |-- fixedUpdate() +LoopManager : |-- update() +LoopManager : |-- render() +' TODO: what is this supposed to be? +@enduml diff --git a/img/gameloop-flow.puml b/img/gameloop-flow.puml new file mode 100644 index 0000000..e75ea42 --- /dev/null +++ b/img/gameloop-flow.puml @@ -0,0 +1,26 @@ +@startuml +!include theme.ipuml +start + +:Initialize LoopManager; +:Start LoopTimer; + +repeat +	:Update LoopTimer; +	:Check for Events; +	:Process Input; + +	while (Lag >= Fixed Delta Time?) is (yes) +		:Perform Fixed Update; +		:Advance Fixed Update; +	endwhile + +	:Perform Normal Update; +	:Render Frame; + +repeat while (Game Running?) + +:Game exit logic; + +stop +@enduml  |