From e7c7dbaf393b48bda8d863cd6a64cd6da8f0dd2d Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Wed, 22 Jun 2016 03:02:51 +0200 Subject: [PATCH] bugfixes --- Crystal.cpp | 2 +- Weapon.cpp | 12 +----------- World.cpp | 7 ++----- worlds/worlds.json | 4 ++-- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Crystal.cpp b/Crystal.cpp index fee4d5c..fda78ed 100644 --- a/Crystal.cpp +++ b/Crystal.cpp @@ -40,7 +40,7 @@ Crystal::~Crystal() void Crystal::draw() { - crystalRot -= 3.0f; + crystalRot -= 0.5f; rotation = Vec3f(0, crystalRot, 0); Entity::draw(); } diff --git a/Weapon.cpp b/Weapon.cpp index 878433b..f0d0110 100644 --- a/Weapon.cpp +++ b/Weapon.cpp @@ -75,17 +75,7 @@ void Weapon::draw(){ glScalef(scale, scale, scale); - weaponmodel->draw(); - - //Test code for finding anker point - glColor3ub(255, 255, 0); - glTranslatef(ankerPoint.x, ankerPoint.y, ankerPoint.z); - glBegin(GL_LINES); - glVertex2f(0, 4); - glVertex2f(0, -4); - glVertex2f(4, 0); - glVertex2f(-4, 0); - glEnd(); + weaponmodel->draw(); glPopMatrix(); diff --git a/World.cpp b/World.cpp index cddc08b..70126f5 100644 --- a/World.cpp +++ b/World.cpp @@ -268,7 +268,7 @@ float World::getHeight(float x, float y) void World::draw() { - + player->setCamera(); float lightPosition[4] = { 0, 2, 1, 0 }; glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); @@ -281,9 +281,6 @@ void World::draw() GLfloat mat_specular[] = { 0.15, 0.15, 0.15, 0 }; glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); - - - player->setCamera(); skybox->draw(); player->draw(); @@ -340,7 +337,7 @@ void World::update(float elapsedTime) if (enemy->attack) { - remove = true; + player->HpDown(enemy->damage); continue; } enemy->position.y = getHeight(enemy->position.x, enemy->position.z) + 2.0f; diff --git a/worlds/worlds.json b/worlds/worlds.json index ebe7374..2eee541 100644 --- a/worlds/worlds.json +++ b/worlds/worlds.json @@ -1,7 +1,7 @@ { "worlds": [ - "worlds/ice.json", + "worlds/small.json", "worlds/rock.json", - "worlds/small.json" + "worlds/ice.json" ] } \ No newline at end of file