summaryrefslogtreecommitdiffstats
path: root/apps/game_falldown/platform.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/game_falldown/platform.hpp')
-rw-r--r--apps/game_falldown/platform.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/game_falldown/platform.hpp b/apps/game_falldown/platform.hpp
new file mode 100644
index 0000000..e7936cf
--- /dev/null
+++ b/apps/game_falldown/platform.hpp
@@ -0,0 +1,24 @@
+#pragma once
+#include "../../hal/api.hpp"
+#include "../../globals.hpp"
+
+#include "bitset"
+#define PLATFORM_TILE_SIZE 16
+// The original game on TI-84 Plus had 12 tiles per platform
+#define PLATFORM_NUM_TILES (DISPLAY_WIDTH/PLATFORM_TILE_SIZE)
+
+class Platform {
+ private:
+ int m_position_y;
+ int m_speed;
+
+ // Bitset where solid tiles have a size of
+ std::bitset<PLATFORM_NUM_TILES> m_tiles_solid;
+
+ void create_tiles();
+ public:
+ Platform();
+ Platform(int y = DISPLAY_HEIGHT-1, int speed = 1);
+ void update();
+ void draw(Api *app_api);
+};