-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.cpp
More file actions
64 lines (50 loc) · 1.71 KB
/
game.cpp
File metadata and controls
64 lines (50 loc) · 1.71 KB
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
#include "GameManager.h"
#include "LogManager.h"
#include "ResourceManager.h"
#include "Explosion.h"
#include "Color.h"
#include "GameStart.h"
#include "Pause.h"
void loadResources(void);
void populateWorld(void);
int main(int argc, char* argv[]) {
// Start up game manager.
if (GM.startUp()) {
LM.writeLog("Error starting game manager!");
GM.shutDown();
return 0;
}
LM.setFlush(true);
df::splash();
loadResources();
populateWorld();
new df::Pause(df::Keyboard::F10);
GM.run();
GM.shutDown();
}
void loadResources(void) {
RM.loadSprite("sprites/saucer-spr.txt", "enemy");
RM.loadSprite("sprites/ship-spr.txt", "ship");
RM.loadSprite("sprites/bullet-spr.txt", "bullet");
RM.loadSprite("sprites/explosion-spr.txt", "explosion");
RM.loadSprite("sprites/gameover-spr.txt", "gameover");
RM.loadSprite("sprites/gamestart-spr.txt", "gamestart");
RM.loadSprite("sprites/ground-spr.txt", "ground");
RM.loadSprite("sprites/enemy-fish-spr.txt", "enemy-fish");
RM.loadSprite("sprites/enemy-seaweed-spr.txt", "enemy-seaweed");
RM.loadSprite("sprites/player-spr.txt", "player");
RM.loadSprite("sprites/player-crouch-spr.txt", "player-crouch");
RM.loadSprite("sprites/player-powered-spr.txt", "powered-up");
// RM.loadSound("sounds/fire.wav", "fire");
// RM.loadSound("sounds/explode.wav", "explode");
// RM.loadSound("sounds/nuke.wav", "nuke");
// RM.loadSound("sounds/game-over.wav", "game over");
// RM.loadMusic("sounds/start-music.wav", "start music");
}
void populateWorld(void) {
// Create some Stars.
// for (int i=0; i<16; i++)
// new Star;
// Spawn GameStart object.
new GameStart();
}