forked from nakidai/csnake
Fix player creating
parent
fac72a00ed
commit
75fb0965f1
|
@ -6,14 +6,14 @@ Player *playerCreate(Direction direction, int x, int y, int score)
|
||||||
Player *player = (Player *)malloc(sizeof(Player));
|
Player *player = (Player *)malloc(sizeof(Player));
|
||||||
PlayerNode *head = (PlayerNode *)malloc(sizeof(PlayerNode));
|
PlayerNode *head = (PlayerNode *)malloc(sizeof(PlayerNode));
|
||||||
|
|
||||||
|
head->x = x;
|
||||||
|
head->y = y;
|
||||||
|
head->next = NULL;
|
||||||
|
|
||||||
player->tail = head;
|
player->tail = head;
|
||||||
player->head = head;
|
player->head = head;
|
||||||
player->score = score;
|
player->score = score;
|
||||||
player->direction = direction;
|
player->direction = direction;
|
||||||
|
|
||||||
head->x = x;
|
|
||||||
head->y = y;
|
|
||||||
head->next = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void playerFree(Player *player)
|
void playerFree(Player *player)
|
||||||
|
|
Loading…
Reference in New Issue