feat: added pipes and logic for pipes

This commit is contained in:
DarthMooMancer
2025-09-04 16:49:56 -04:00
parent c0f43e6e4e
commit de4f9facf6
5 changed files with 76 additions and 6 deletions
+11 -1
View File
@@ -8,13 +8,23 @@ struct Point {
Point(int row, int col) : m_row(row), m_col(col) {};
int m_row;
int m_col;
void assign(int row, int col);
void to_string();
};
struct Bird {
Bird() : m_fly(false) {};
Point m_body {(ROW/2), 2};
Point m_body {(ROW/2), 4};
bool m_fly;
void move();
void check_collision();
};
struct Pipe {
Pipe();
int m_size;
Point m_nodes[ROW];
void move();
};
#endif
+2 -1
View File
@@ -2,12 +2,13 @@
#define WINDOW_HPP
#include <array>
#include <vector>
#include "globals.hpp"
#include "elements.hpp"
struct Window {
std::array<std::array<char, COL>, ROW> m_board = {};
void update_display(Bird &bird);
void update_display(Bird &bird, std::vector<Pipe> pipes);
void tick(int fps);
};