-
Notifications
You must be signed in to change notification settings - Fork 0
/
gamescreen.c
69 lines (59 loc) · 1.42 KB
/
gamescreen.c
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
58
59
60
61
62
63
64
65
66
67
68
69
#include "gamescreen.h"
#include <stdio.h>
#include <tari/actorhandler.h>
#include <tari/input.h>
#include <tari/collisionhandler.h>
#include <tari/stagehandler.h>
#include "stage.h"
#include "mirklinghandler.h"
#include "player.h"
#include "deathcount.h"
#include "preciouspeople.h"
#include "upgrades.h"
#include "collision.h"
#include "particles.h"
#include "levelhandler.h"
#include "titlescreen.h"
#include "gameoverscreen.h"
#include "soundeffect.h"
#include "explosion.h"
#include "routehandler.h"
#include "noise.h"
#include "pausemenu.h"
static void loadGameScreen() {
initGameSoundEffects();
loadMirklingsCollisions();
instantiateActor(StageBP);
instantiateActor(MirklingHandlerBP);
loadPreciousPeople();
loadUpgrades();
instantiateActor(DeathCountBP);
instantiateActor(PlayerBP);
instantiateActor(PauseMenuBP);
loadParticles();
loadExplosions();
loadScreenNoise();
startNewRoute();
// activateCollisionHandlerDebugMode();
// setCollisionHandlerDebuggingScreenPositionReference(getStagePositionReference());
}
static void updateGameScreen() {
updateParticles();
updateRouteHandler();
}
static Screen* getNextGameScreenScreen() {
if (hasPressedAbortFlank()) {
return &TitleScreen;
}
if (!hasPreciousPeopleLeft()) {
return &GameOverScreen;
}
return NULL;
}
Screen GameScreen = {
.mLoad = loadGameScreen,
.mUnload = NULL,
.mDraw = NULL,
.mUpdate = updateGameScreen,
.mGetNextScreen = getNextGameScreenScreen
};