MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / Init

Function Init

Project_Snake_Game/snake-game.cpp:37–48  ·  view source on GitHub ↗

Initial values when game start

Source from the content-addressed store, hash-verified

35
36//Initial values when game start
37void 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
51void Map() {

Callers 1

startGameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected