This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "clock.h" | |
| #include <chrono> | |
| Clock::Clock() : lastTick { std::chrono::steady_clock::now() }, deltaTime { 0 } | |
| { | |
| } | |
| void Clock::tick() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int getRandomValue(int min, int max) | |
| { | |
| static std::random_device rd {}; | |
| static std::mt19937 mt { rd() }; | |
| std::uniform_int_distribution<std::mt19937::result_type> dist(min, max); | |
| return dist(mt); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef COLORS_H | |
| #define COLORS_H | |
| #include "SDL.h" | |
| // Custom color palette | |
| inline constexpr SDL_Color LIGHTGRAY { 200, 200, 200, 255 }; // Light Gray | |
| inline constexpr SDL_Color GRAY { 130, 130, 130, 255 }; // Gray | |
| inline constexpr SDL_Color DARKGRAY { 80, 80, 80, 255 }; // Dark Gray |