Initial values when game start
| 35 | |
| 36 | //Initial values when game start |
| 37 | void Init() { |
| 38 | game = true; |
| 39 | dir = STOP; |
| 40 | x = width / 2; |
| 41 | y = height / 2; |
| 42 | fx = rand() % width; |
| 43 | fy = rand() % height; |
| 44 | score = 0; |
| 45 | tx[100] = {}; |
| 46 | ty[100] = {}; |
| 47 | |
| 48 | } |
| 49 | |
| 50 | //Creating a map container where snake and fruit appears |
| 51 | void Map() { |