-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameScene.cpp
50 lines (41 loc) · 951 Bytes
/
GameScene.cpp
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* Implementation of the GameScene class.
*
* @author Francis BISSON
*/
// INCLUDES ////////////////////////////////////////////////////////////////////
#include "Color.h"
#include "DisplayContext.h"
#include "Game.h"
#include "GameScene.h"
#include "Player.h"
#include "Scene.h"
// IMPLEMENTATION //////////////////////////////////////////////////////////////
GameScene::GameScene(Game* game)
:Scene(game)
,m_Player( new Player(game) )
{
}
GameScene::~GameScene()
{
}
bool GameScene::Init()
{
m_GameObjects.push_back(m_Player);
return Scene::Init();
}
void GameScene::Update(double deltaTime)
{
if(m_Game->GetKeyboardDevice().IsKeyTriggered(ESCAPE))
{
m_Game->Quit();
return;
}
Scene::Update(deltaTime);
}
void GameScene::Render(DisplayContext* displayContext)
{
displayContext->SetColor(Color::White);
displayContext->ClearScreen();
Scene::Render(displayContext);
}