Johan is love, Johan is life

This commit is contained in:
2016-05-19 14:25:03 +02:00
parent a38a6d3c5f
commit 7c4ee37867
82 changed files with 550 additions and 1250 deletions
+40
View File
@@ -0,0 +1,40 @@
#include "World.h"
#include <GL/freeglut.h>
#include "Entity.h"
World::World() : player(Player::getInstance())
{
player.position.y = 1.7;
//entities.push_back(new LevelObject("tree"));
}
World::~World()
{
}
void World::draw()
{
player.setCamera();
glColor3f(0.5f, 0.9f, 0.5f);
glBegin(GL_QUADS);
glVertex3f(-50, 0, -50);
glVertex3f(-50, 0, 50);
glVertex3f(50, 0, 50);
glVertex3f(50, 0, -50);
glEnd();
for (auto e : entities)
e->draw();
glutSwapBuffers();
}
void World::update(float elapsedTime)
{
for (auto e : entities)
e->update(elapsedTime);
}