MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Reset

Function Reset

Applications/Snake/main.cpp:57–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55uint8_t snakeMapCells[16][16];
56
57void Reset(){
58 snake.clear();
59 //delete snake;
60 //snake = new List<vector2i_t>();
61
62 snake.push_back({8,8});
63 snake.push_back({9,8});
64
65 gameOver = false;
66
67 powerUp = 0;
68 snakeCellColours[0] = bgColourDefault;
69
70 direction = 0;
71
72 for(int i = 0; i < 16; i++){
73 for(int j = 0; j < 16; j++){
74 snakeMapCells[i][j] = SNAKE_CELL_EMPTY;
75 }
76 }
77
78 clock_gettime(CLOCK_BOOTTIME, &timer);
79}
80
81vector2i_t applePos = {1,1};
82

Callers 1

mainFunction · 0.70

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected