From bd6b5006f814daca16afd3a15eebd02ef696624b Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 9 Nov 2019 14:48:33 +0100 Subject: Basic Game Bird falls, game over if he touches the floor or a pipe. Pipes are randomly generated. --- graphics.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'graphics.hpp') diff --git a/graphics.hpp b/graphics.hpp index 75d273c..f9dc4f7 100644 --- a/graphics.hpp +++ b/graphics.hpp @@ -2,8 +2,11 @@ #define __GRAPHIC_H__ #include +#include #include +typedef std::pair PipePair; + class Graphics { public: @@ -15,7 +18,15 @@ class Graphics SDL_Renderer *renderer; SDL_Window *window; bool running; + SDL_Rect bird; + std::deque pipes; + void update(); + void draw_bird(); + void draw_pipes(); + bool is_gameover(); + void handle_pipes(); + PipePair generate_pipe_pair(); void event_handler(); void error_quit(std::string msg); }; -- cgit