Source.cpp

//source.cpp #include "game_state.h" #include "main_menu.h" #include <iostream> #include "choose_player.h" game_state coreState; bool quitGame = false; int main() { sf::RenderWindow window(sf::VideoMode(1000, 650), "Ping",sf::Style::Titlebar | sf::Style::Close); coreState.SetWindow(&window); coreState.SetState(new main_menu()); window.setPosition(sf::Vector2i(100, 50)); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close(); } window.clear(sf::Color::Color(0, 38, 77,200)); coreState.Update(); coreState.Render(); window.display(); if (quitGame) { window.close(); } } return 0; } //multiplayer_game.cpp sf::Event event; while (window->pollEvent(event)) { if ((event.type == sf::Event::KeyReleased) && (event.key.code == sf::Keyboard::Escape)) { coreState.SetState(new choose_player); } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.