GDC-WM / 2DGame2021

Has a very nice backend structure but no real gameplay (yet?)
MIT License
1 stars 1 forks source link

Consider migrating time system to sf::Clock #34

Closed BlastWind closed 3 years ago

BlastWind commented 3 years ago

In bin/main.cpp, we are using std::chrono to implement a fixed 60 frames per second game loop. SFML provides a sf::Clock module in handling this kind of stuff as well, perhaps use it instead?

https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Clock.php

BlastWind commented 3 years ago

Furthermore, Spritesheet.cpp uses sf::Clock as well, migrate this?

aaronamk commented 3 years ago

No

BlastWind commented 3 years ago

Haha, mean!

For those wondering why we chose not to: sf::Clock doesn't provide much extra abstraction, so, we are better off using the C++ standard library std to handle time. This way, if we were to for some reason migrate to another rendering library like SDL, we can still retain the time handling code.