-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame.cpp
57 lines (42 loc) · 1018 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
47
48
49
50
51
52
53
54
55
56
57
//
// game.cpp
//
#define VERSION 1.4
// Engine includes.
#include "GameManager.h"
#include "LogManager.h"
// Game includes.
#include "Hero.h"
#include "Saucer.h"
#include "Star.h"
// Function prototypes.
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;
}
// Write game version information to logfile.
LM.writeLog("Saucer Shoot Naiad, version %0.1f", VERSION);
// Set flush of logfile during development (when done, make false).
LM.setFlush(true);
// Setup some objects.
populateWorld();
// Run game (this blocks until game loop is over).
GM.run();
// Shut everything down.
GM.shutDown();
}
// Populate world with some objects.
void populateWorld(void) {
// Spawn some Stars.
for (int i=0; i<16; i++)
new Star;
// Create hero.
new Hero;
// Spawn some saucers to shoot.
for (int i=0; i<16; i++)
new Saucer;
}