From cf7a38d87164a9be78efd8c045acd43422a1be04 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Sat, 26 Oct 2024 08:51:31 +0200 Subject: design gameloop, design --- img/gameloop-class.puml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 img/gameloop-class.puml (limited to 'img/gameloop-class.puml') 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 -- cgit v1.2.3