forked from Illiux/Diabolical-Fuckup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel.cpp
More file actions
40 lines (34 loc) · 739 Bytes
/
Copy pathlevel.cpp
File metadata and controls
40 lines (34 loc) · 739 Bytes
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
#include "level.h"
#include "platform.h"
void Level::addPlatform(GameObject *obj)
{
platforms.push_back(obj);
}
void Level::addObject(Item *obj)
{
objects.push_back(obj);
}
Level::Level()
{
Platform *platform = new Platform(-50,0,40,600);
Platform *platform2 = new Platform(810,0,40,600);
platforms.push_back(platform);
platforms.push_back(platform2);
}
void Level::draw()
{
std::vector<GameObject *>::iterator i;
std::vector<Item *>::iterator j;
for (j=objects.begin(); j<objects.end(); j++) {
(*j)->draw();
}
for (i=platforms.begin(); i<platforms.end(); i++) {
(*i)->draw();
}
}
std::vector<GameObject *>* Level::getPlatforms() {
return &platforms;
}
std::vector<Item *>* Level::getObjects() {
return &objects;
}