fix: fixed collision of pipe where it only did the first and not all pipes
This commit is contained in:
+7
-5
@@ -40,11 +40,13 @@ int main() {
|
|||||||
if(pipes.front().m_nodes->m_col < 3) {
|
if(pipes.front().m_nodes->m_col < 3) {
|
||||||
_delete_pipe(pipes);
|
_delete_pipe(pipes);
|
||||||
}
|
}
|
||||||
for(int i = 0; i < pipes.front().m_size; i++) {
|
for(int j = 0; j < pipes.size(); j++) {
|
||||||
if(pipes.front().m_nodes[i].m_col == bird.m_body.m_col) {
|
for(int i = 0; i < pipes.front().m_size; i++) {
|
||||||
if(pipes.front().m_nodes[i].m_row == bird.m_body.m_row) {
|
if(pipes.at(j).m_nodes[i].m_col == bird.m_body.m_col) {
|
||||||
running = false;
|
if(pipes.at(j).m_nodes[i].m_row == bird.m_body.m_row) {
|
||||||
std::cout << "You died!" << std::endl;
|
running = false;
|
||||||
|
std::cout << "You died!" << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user