-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.cpp
57 lines (47 loc) · 1.31 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
#include "game.h"
Game::Game()
{
initGame();
//network.getInternetList();
Menu menu(view,input);
menu.tween();
while(input.getRun())
{
for(view.frameBegin(); menu.mainLoop(); view.frameEnd());
if(input.getRun() == false) break;
GameTable table(view);
GameManager manager(menu.getMode(), menu.getPlace(), view, input, table, network);
while(manager.getRun())
{
manager.newRound();
while(manager.getRound())
{
network.mainLoop();
view.frameBegin();
input.poll(view.frameDelay());
table.mainLoop();
table.draw();
view.swap();
manager.checkState();
view.frameEnd();
}
if (manager.getShowScoreBoard())
{
ScoreBoard scoreBoard(view,input,table);
for(view.frameBegin(); scoreBoard.mainLoop(); view.frameEnd());
if (input.getRun()) input.setRun(!scoreBoard.getEndOfGame());
}
}
}
}
Game::~Game()
{
}
void Game::initGame()
{
srand(time(0));
SDL_WM_SetCaption("Bombás játék","Bombás játék");
view.setTickInterval(16);
input.setView(&view);
view.loadPackage("img/img.ls");
}