feat: collision between bird and pipes

This commit is contained in:
DarthMooMancer
2025-09-04 19:23:54 -04:00
parent 7eb00ac31d
commit 152a2e0a8a
2 changed files with 8 additions and 2 deletions
+8
View File
@@ -40,6 +40,14 @@ int main() {
if(pipes.front().m_nodes->m_col < 3) {
_delete_pipe(pipes);
}
for(int i = 0; i < pipes.front().m_size; i++) {
if(pipes.front().m_nodes[i].m_col == bird.m_body.m_col) {
if(pipes.front().m_nodes[i].m_row == bird.m_body.m_row) {
running = false;
std::cout << "You died!" << std::endl;
}
}
}
window.update_display(bird, pipes);
frames++;
if(frames > 4) {