diff --git a/src/main.c b/src/main.c index 865ce26c174553b089d72eca45f04fa0a8d69bc6..805a7249be7cb767889973fb208401441dad90bb 100644 --- a/src/main.c +++ b/src/main.c @@ -128,9 +128,24 @@ int main(void) { case PLAYING: // Draw snake for (int i = 0; i < snake.length; i++) { - DrawRectangle(snake.segments[i].x * CELL_SIZE, - snake.segments[i].y * CELL_SIZE, - CELL_SIZE, CELL_SIZE, GREEN); + if (i == 0) { + DrawCircle(snake.segments[i].x * CELL_SIZE + CELL_SIZE/2, + snake.segments[i].y * CELL_SIZE + CELL_SIZE/2, + CELL_SIZE/2, DARKGREEN); + // Eyes for the head + DrawCircle(snake.segments[i].x * CELL_SIZE + CELL_SIZE/3, + snake.segments[i].y * CELL_SIZE + CELL_SIZE/3, + CELL_SIZE/8, YELLOW); + DrawCircle(snake.segments[i].x * CELL_SIZE + 2*CELL_SIZE/3, + snake.segments[i].y * CELL_SIZE + CELL_SIZE/3, + CELL_SIZE/8, YELLOW); + } + // Draw snake body + else { + DrawCircle(snake.segments[i].x * CELL_SIZE + CELL_SIZE/2, + snake.segments[i].y * CELL_SIZE + CELL_SIZE/2, + CELL_SIZE/2 - 2, GREEN); + } } // Draw food @@ -147,27 +162,26 @@ int main(void) { break; case PAUSED: - for (int i = 0; i < snake.length; i++){ + for (int i = 0; i < snake.length; i++) { if (i == 0) { DrawCircle(snake.segments[i].x * CELL_SIZE + CELL_SIZE/2, - snake.segments[i].y * CELL_SIZE + CELL_SIZE/2, - CELL_SIZE/2, DARKGREEN); + snake.segments[i].y * CELL_SIZE + CELL_SIZE/2, + CELL_SIZE/2, DARKGREEN); // Eyes for the head DrawCircle(snake.segments[i].x * CELL_SIZE + CELL_SIZE/3, - snake.segments[i].y * CELL_SIZE + CELL_SIZE/3, - CELL_SIZE/8, YELLOW); + snake.segments[i].y * CELL_SIZE + CELL_SIZE/3, + CELL_SIZE/8, YELLOW); DrawCircle(snake.segments[i].x * CELL_SIZE + 2*CELL_SIZE/3, - snake.segments[i].y * CELL_SIZE + CELL_SIZE/3, - CELL_SIZE/8, YELLOW); + snake.segments[i].y * CELL_SIZE + CELL_SIZE/3, + CELL_SIZE/8, YELLOW); } // Draw snake body else { DrawCircle(snake.segments[i].x * CELL_SIZE + CELL_SIZE/2, - snake.segments[i].y * CELL_SIZE + CELL_SIZE/2, - CELL_SIZE/2 - 2, GREEN); + snake.segments[i].y * CELL_SIZE + CELL_SIZE/2, + CELL_SIZE/2 - 2, GREEN); } - } - + } DrawRectangle(food.position.x * CELL_SIZE, food.position.y * CELL_SIZE,