-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.cpp
More file actions
71 lines (57 loc) · 1.84 KB
/
game.cpp
File metadata and controls
71 lines (57 loc) · 1.84 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
65
66
67
68
69
70
71
// Engine includes.
#include <DisplayManager.h>
#include <GameManager.h>
#include <LogManager.h>
#include <ResourceManager.h>
#include <WorldManager.h>
#include "vs-2019/Enemy.h"
#include "vs-2019/GameStart.h"
#include "vs-2019/Player.h"
#include <direct.h>
void loadResources() {
RM.loadSprite("sprites/player-chr.txt", "player");
RM.loadSprite("sprites/enemy-chr.txt", "enemy");
RM.loadSprite("sprites/boss-chr.txt", "boss");
RM.loadSprite("sprites/bullet-spr.txt", "bullet");
RM.loadSprite("sprites/hero-bullet-spr.txt", "herobullet");
RM.loadSprite("sprites/explosion-spr.txt", "explosion");
RM.loadSprite("sprites/gamestart-spr.txt", "gamestart");
RM.loadSprite("sprites/gameover-spr.txt", "gameover");
RM.loadSprite("sprites/circle-flash-bullet-spr.txt", "circleflashbullet");
RM.loadSprite("sprites/hitbox-spr.txt", "PlayerHitbox");
RM.loadSprite("sprites/star-spr.txt", "Star");
RM.loadSprite("sprites/simple-bullet-spr.txt", "SimpleBullet");
RM.loadSound("sfx/plst00.wav", "fire");
RM.loadSound("sfx/tan00.wav", "enemyhit");
RM.loadSound("sfx/pldead00.wav", "playerhit");
RM.loadSound("sfx/enep00.wav", "bomb");
RM.loadSound("sfx/enep01.wav", "bossdown");
RM.loadMusic("music/necrofantasia-bk.ogg", "music");
}
void populateWorld() {
// stars go here
new GameStart();
}
int main(int argc, char* argv[]) {
LM.setLogLevel(1);
// Start up game manager.
if (GM.startUp()) {
char tmp[256];
_getcwd(tmp, 256);
LM.writeLog("Working directory: %s", tmp);
LM.writeLog("Error starting game manager!");
GM.shutDown();
return 0;
}
// Set flush of logfile during development (when done, make false).
LM.setFlush(true);
// ~~Show splash screen.~~ (nah, not yet)
// df::splash();
// Load game resources
loadResources();
// Populate game world with objects
populateWorld();
GM.run();
// Shut everything down.
GM.shutDown();
}