Updated: fixed some stuff
This commit is contained in:
parent
222b838e53
commit
fffcbbf123
2 changed files with 2 additions and 2 deletions
|
@ -253,7 +253,6 @@ void updateSnake() {
|
|||
snake->tail->next = NULL;
|
||||
snake->head->prev->prev = NULL;
|
||||
snake->head = snake->head->prev;
|
||||
|
||||
} else {
|
||||
/* If the head overlaps with an apple (the snake ate an apple), move the apple to a new position */
|
||||
updateApple();
|
||||
|
@ -479,6 +478,7 @@ int initializeGame() {
|
|||
/* Initialize the apple */
|
||||
apple = startApple();
|
||||
|
||||
/* Run the game */
|
||||
run();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ typedef struct Snake {
|
|||
|
||||
/* Apple structure */
|
||||
typedef struct Food {
|
||||
int pX, pY; /* represents the apple's position on the board */
|
||||
int pX, pY; /* represents the apple's position on the board */
|
||||
} Apple;
|
||||
|
||||
#endif //SERPENT_H
|
||||
|
|
Loading…
Reference in a new issue