aboutsummaryrefslogtreecommitdiff
path: root/img
diff options
context:
space:
mode:
Diffstat (limited to 'img')
-rw-r--r--img/event-uml.drawio.pngbin0 -> 217362 bytes
-rw-r--r--img/gameloop-class.puml35
-rw-r--r--img/gameloop-flow.puml27
3 files changed, 62 insertions, 0 deletions
diff --git a/img/event-uml.drawio.png b/img/event-uml.drawio.png
new file mode 100644
index 0000000..9eab458
--- /dev/null
+++ b/img/event-uml.drawio.png
Binary files differ
diff --git a/img/gameloop-class.puml b/img/gameloop-class.puml
new file mode 100644
index 0000000..c9d7917
--- /dev/null
+++ b/img/gameloop-class.puml
@@ -0,0 +1,35 @@
+@startuml
+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()
+@enduml
diff --git a/img/gameloop-flow.puml b/img/gameloop-flow.puml
new file mode 100644
index 0000000..1a46cd7
--- /dev/null
+++ b/img/gameloop-flow.puml
@@ -0,0 +1,27 @@
+@startuml
+title Game Loop Flowchart
+
+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