Index: apps/plugins/snake.c =================================================================== --- apps/plugins/snake.c (revision 19417) +++ apps/plugins/snake.c (working copy) @@ -185,7 +185,7 @@ static int board[BOARD_WIDTH][BOARD_HEIGHT],snakelength; static unsigned int score,hiscore=0,level=1; -static short dir,frames,apple,dead=0; +static short dir,apple,dead=0; static const struct plugin_api* rb; void die (void) @@ -348,19 +348,15 @@ frame(); if (dead) return; - frames++; - if (frames==10) { - frames=0; - if (!apple) { - do { - x=rb->rand() % BOARD_WIDTH; - y=rb->rand() % BOARD_HEIGHT; - } while (board[x][y]); - apple=1; - board[x][y]=-1; - rb->lcd_fillrect((x*4)+1,y*4,2,4); - rb->lcd_fillrect(x*4,(y*4)+1,4,2); - } + if (!apple) { + do { + x=rb->rand() % BOARD_WIDTH; + y=rb->rand() % BOARD_HEIGHT; + } while (board[x][y]); + apple=1; + board[x][y]=-1; + rb->lcd_fillrect((x*4)+1,y*4,2,4); + rb->lcd_fillrect(x*4,(y*4)+1,4,2); } rb->sleep(HZ/level);