refactor
This commit is contained in:
+3
-3
@@ -9,13 +9,13 @@ int main () {
|
||||
std::srand(std::time(0));
|
||||
Window window;
|
||||
Input input;
|
||||
Fruit fruit(window.m_board);
|
||||
Fruit fruit;
|
||||
Body body;
|
||||
Head head;
|
||||
bool running = true;
|
||||
std::thread input_thread(
|
||||
&Input::get_input, &input,
|
||||
std::ref(head.m_head.m_direction),
|
||||
std::ref(head.m_direction),
|
||||
std::ref(running));
|
||||
|
||||
while (running) {
|
||||
@@ -31,7 +31,7 @@ int main () {
|
||||
fruit.get_new_pos(window.m_board, head);
|
||||
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);
|
||||
head.m_previous_head.set_new_point(head.m_head);
|
||||
window.update_display(fruit, head, body);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user