From 3ee74cdb1b4fd2bf9eefdf6bcd8439b27cbb7336 Mon Sep 17 00:00:00 2001 From: cflip Date: Fri, 1 Apr 2022 21:23:01 -0600 Subject: Add a game timer This adds a delta time that ensures that everything moves at the same speed regardless of framerate or system. --- src/level.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/level.h') diff --git a/src/level.h b/src/level.h index fa6376d..c706b06 100644 --- a/src/level.h +++ b/src/level.h @@ -36,7 +36,7 @@ public: void set(int x, int y, uint8_t tile); bool inBounds(int x, int y) const { return x >= 0 && x < m_width && y >= 0 && y < m_height; } - void update(); + void update(float deltaTime); void draw(Bitmap& bitmap, int xo, int yo); void addVehicle(int x, int y); -- cgit v1.2.3