-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.cpp
46 lines (32 loc) · 887 Bytes
/
game.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
#include "precomp.h"
#include "game.h"
#include "scene.h"
namespace Tmpl8
{
void Game::Init()
{
myScene = new scene(screen);
const auto seed = static_cast<unsigned>(time(nullptr));
srand(seed);
}
void Game::Tick(float deltaTime)
{
myScene->passDeltatime(deltaTime);
myScene->Tick();
}
void Game::Shutdown()
{
delete myScene;
myScene = nullptr;
}
void Game::KeyUp(int key) { myScene->passKeyUpInput(key);}
void Game::KeyDown(int key)
{
myScene->passKeyDownInput(key);
}
void Game::MouseMove(int x, int y) { myScene->passMouseInput(x, y); }
void Game::MouseMoveRel(int xrel, int yrel) { myScene->passMouseInputRel(xrel, yrel); }
void Game::MouseWheel(int yScroll) { myScene->passMouseScroll(yScroll); }
void Game::MouseDown(int button) { myScene->passMouseDown(button); }
void Game::MouseUp(int button) { myScene->passMouseUp(button); }
};