summaryrefslogtreecommitdiffhomepage
path: root/GameScreen.cpp
blob: 02aab00692bc77312668273c106678c0abf10be4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "GameScreen.h"

#include <memory>
#include <utility>

#include <raylib.h>

#include "Stage.h"


GameScreen::GameScreen(std::unique_ptr<Stage> stage) :
    m_stage {std::move(stage)}
{
}


void
GameScreen::update(const float dt)
{
    if (m_stage)
        m_stage->update(dt);
}


void
GameScreen::draw()
{
    if (m_stage) {
        m_stage->draw();
        DrawText(TextFormat("%d", m_stage->total_bullets()), 5, 25, 20, DARKGRAY);
    }
    DrawFPS(5, 5);
}