From cfa0e5270521d13e8cc21cf48e446e7ea22384f5 Mon Sep 17 00:00:00 2001 From: DarthMooMancer Date: Sat, 30 Aug 2025 13:26:31 -0400 Subject: [PATCH] final commit for the time being --- include/element.hpp | 2 +- include/globals.hpp | 6 ++---- src/element.cpp | 2 +- src/main.cpp | 6 +++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/element.hpp b/include/element.hpp index 392d60f..7f727d8 100644 --- a/include/element.hpp +++ b/include/element.hpp @@ -23,7 +23,7 @@ struct Body { bool m_collision; void check_new_tail(); void check_collision(Head &head); - void get_new_points(Head &head); + void get_new_pos(Head &head); }; struct Fruit { diff --git a/include/globals.hpp b/include/globals.hpp index b907a05..66b8581 100644 --- a/include/globals.hpp +++ b/include/globals.hpp @@ -1,9 +1,7 @@ #ifndef GLOBALS_HPP #define GLOBALS_HPP -#include - -constexpr uint16_t ROW = 11; -constexpr uint16_t COL = 11; +constexpr unsigned int ROW = 11; +constexpr unsigned int COL = 11; #endif // GLOBALS_HPP diff --git a/src/element.cpp b/src/element.cpp index c7896a1..c18e90c 100644 --- a/src/element.cpp +++ b/src/element.cpp @@ -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++) { m_body.front().m_previous_tail_pos.set_new_point( head.m_previous_head.m_row, diff --git a/src/main.cpp b/src/main.cpp index ccff63d..38c68e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,10 +28,10 @@ int main () { running = false; } 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); + 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); }