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

Function main

Project_Labirint_Game/olaf-game.cpp:156–199  ·  view source on GitHub ↗

main part

Source from the content-addressed store, hash-verified

154
155//main part
156int main()
157{
158 k = 0;
159 //Identifiers Picture
160 sf::Texture TextMainMenu; TextMainMenu.loadFromFile("Main_Menu.jpg"); MainMenu.setTexture(&TextMainMenu);
161 sf::Texture TextHelp; TextHelp.loadFromFile("Help.jpg"); Help.setTexture(&TextHelp);
162 sf::Texture TextDevelopers; TextDevelopers.loadFromFile("Developers.jpg"); Developers.setTexture(&TextDevelopers);
163 sf::Texture TextQuit; TextQuit.loadFromFile("Quit_Main.jpg"); Quit.setTexture(&TextQuit);
164 sf::Texture TextLoading1; TextLoading1.loadFromFile("Loading1.jpg"); Loading_1.setTexture(&TextLoading1);
165 sf::Texture TextLoading2; TextLoading2.loadFromFile("Loading2.jpg"); Loading_2.setTexture(&TextLoading2);
166 sf::Texture TextLoading3; TextLoading3.loadFromFile("Loading3.jpg"); Loading_3.setTexture(&TextLoading3);
167 sf::Texture TextMap; TextMap.loadFromFile("Map.png"); Map.setTexture(&TextMap);
168 sf::Texture TextPlayer_1; TextPlayer_1.loadFromFile("Player.png"); Player.setTexture(&TextPlayer_1);
169
170 // Musics
171 //if (!Rington.loadFromFile("Rington.wav")) { cout << "ERROR" << endl; } sound_Rington.setBuffer(Rington);
172 //if (!BackMusic.loadFromFile("BackMusic.wav")) { cout << "ERROR" << endl; } sound_BackMusic.setBuffer(BackMusic);
173
174 //Starting point
175 while (window.isOpen())
176 {
177
178 sf::Event evnt;
179 while (window.pollEvent(evnt))
180 {
181 switch (evnt.type) {
182 case sf::Event::Closed: window.close();
183 break;
184 case sf::Event::Resized:;
185 break;
186 }
187 }
188 //Others
189
190
191 // Outputs
192 if (k == 0) {// sound_BackMusic.play();
193 F_Loading(); k++; }
194 //k = 1;
195 if (k == 1) { F_MainMenu(); }
196 }
197
198 return 0;
199}

Callers

nothing calls this directly

Calls 2

F_MainMenuFunction · 0.85
F_LoadingFunction · 0.70

Tested by

no test coverage detected