• GameStart.cpp
  • #include "../Game.h"
    #include "../BackgroundRenderer.hpp"
    
    void Game::GameStartScene() {
        NewScene(0, std::move(ImageBackgroundRenderer{}), false, true, false); 
        SwitchScene(0); 
        ExecuteForScene<ImageBackgroundRenderer>(0,[&](Gorgon::Game::Template::Scene<ImageBackgroundRenderer>& scene) {
            using namespace Gorgon::UI::literals;
    
            welcome.Move(250_px, 400_px);
            welcome.SetWidth(600_px);
            welcome.Text = "# Press space to start playing the game!";
            
            scene.GetUI().Add(welcome);
    
            scene.OnKeyEvent.Register([&](Gorgon::Input::Key key, float active) {
                if(key == Keycodes::Space and active) {
                    SwitchScene(1); 
                    timer.Start();
                }
            });
        }); 
    }