Skip to content

Commit

Permalink
fixed bug in easter_egg2
Browse files Browse the repository at this point in the history
  • Loading branch information
stocyr committed Apr 21, 2012
1 parent 46ee487 commit 2a710b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/LaserChess.c
Expand Up @@ -692,8 +692,13 @@ void easter_egg2(void)
draw_playground();

// Food generieren: dazu position in sein struct geschrieben, dann wird er gezeichnet.
food.Pos.x = PLAYGROUND_X_MAX * rand() / RAND_MAX;
food.Pos.y = PLAYGROUND_Y_MAX * rand() / RAND_MAX;
do
{
food.Pos.x = PLAYGROUND_X_MAX * rand() / RAND_MAX;
food.Pos.y = PLAYGROUND_Y_MAX * rand() / RAND_MAX;
}
while(food.Pos.x == snake[head].x && food.Pos.y == snake[head].y); // solange, bis food auf leerem feld

map[food.Pos.x][food.Pos.y] = &food;
draw_figure(&food);

Expand Down

0 comments on commit 2a710b0

Please sign in to comment.