wip
This commit is contained in:
+5
-11
@@ -18,6 +18,11 @@ int main (int argc, char *argv[]) {
|
||||
std::thread input_thread(&Input::get_input, &input);
|
||||
bool running = true;
|
||||
int count = 0;
|
||||
/* NOTE
|
||||
* if 3 or 4 then "-"
|
||||
* if 1 or 2 then "|"
|
||||
* if "corner" then "~"
|
||||
*/
|
||||
while (running) {
|
||||
switch (input.m_current_key) {
|
||||
case 's':
|
||||
@@ -38,17 +43,6 @@ int main (int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
fruit.reset(window.m_board, snake.m_head.m_row, snake.m_head.m_col, window.m_score, count);
|
||||
if (window.m_score % 2 == 0 && count > 0) {
|
||||
if (snake.m_direction == 1) {
|
||||
int r = snake.m_head.m_row;
|
||||
if (r + 1 > ROW - 1) {
|
||||
r = snake.m_head.m_row;
|
||||
}
|
||||
snake.create_tail(snake.m_head.m_row + r + 1, snake.m_head.m_col);
|
||||
++r;
|
||||
}
|
||||
count--;
|
||||
}
|
||||
|
||||
/* TODO
|
||||
* update tail positions
|
||||
|
||||
Reference in New Issue
Block a user