final commit for the time being
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ struct Body {
|
|||||||
bool m_collision;
|
bool m_collision;
|
||||||
void check_new_tail();
|
void check_new_tail();
|
||||||
void check_collision(Head &head);
|
void check_collision(Head &head);
|
||||||
void get_new_points(Head &head);
|
void get_new_pos(Head &head);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Fruit {
|
struct Fruit {
|
||||||
|
|||||||
+2
-4
@@ -1,9 +1,7 @@
|
|||||||
#ifndef GLOBALS_HPP
|
#ifndef GLOBALS_HPP
|
||||||
#define GLOBALS_HPP
|
#define GLOBALS_HPP
|
||||||
|
|
||||||
#include <cstdint>
|
constexpr unsigned int ROW = 11;
|
||||||
|
constexpr unsigned int COL = 11;
|
||||||
constexpr uint16_t ROW = 11;
|
|
||||||
constexpr uint16_t COL = 11;
|
|
||||||
|
|
||||||
#endif // GLOBALS_HPP
|
#endif // GLOBALS_HPP
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ void Body::check_new_tail() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Body::get_new_points(Head &head) {
|
void Body::get_new_pos(Head &head) {
|
||||||
for (int i = 0; i < m_body.size(); i++) {
|
for (int i = 0; i < m_body.size(); i++) {
|
||||||
m_body.front().m_previous_tail_pos.set_new_point(
|
m_body.front().m_previous_tail_pos.set_new_point(
|
||||||
head.m_previous_head.m_row,
|
head.m_previous_head.m_row,
|
||||||
|
|||||||
+3
-3
@@ -28,10 +28,10 @@ int main () {
|
|||||||
running = false;
|
running = false;
|
||||||
}
|
}
|
||||||
head.get_new_pos();
|
head.get_new_pos();
|
||||||
body.get_new_points(head);
|
|
||||||
head.m_previous_head.set_new_point(head.m_head.m_row, head.m_head.m_col, head.m_head.m_direction);
|
|
||||||
|
|
||||||
fruit.get_new_pos(window.m_board, head, body.m_score);
|
fruit.get_new_pos(window.m_board, head, body.m_score);
|
||||||
|
body.get_new_pos(head);
|
||||||
|
|
||||||
|
head.m_previous_head.set_new_point(head.m_head.m_row, head.m_head.m_col, head.m_head.m_direction);
|
||||||
window.update_display(fruit, head, body);
|
window.update_display(fruit, head, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user