Kenneth van Ewijk 9 سال پیش
والد
کامیت
e7c7dbaf39
4فایلهای تغییر یافته به همراه6 افزوده شده و 19 حذف شده
  1. 1 1
      Crystal.cpp
  2. 1 11
      Weapon.cpp
  3. 2 5
      World.cpp
  4. 2 2
      worlds/worlds.json

+ 1 - 1
Crystal.cpp

@@ -40,7 +40,7 @@ Crystal::~Crystal()
 
 void Crystal::draw()
 {	
-	crystalRot -= 3.0f;
+	crystalRot -= 0.5f;
 	rotation = Vec3f(0, crystalRot, 0);
 	Entity::draw();	
 }

+ 1 - 11
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();
 

+ 2 - 5
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;

+ 2 - 2
worlds/worlds.json

@@ -1,7 +1,7 @@
 {
   "worlds": [
-      "worlds/ice.json",
+      "worlds/small.json",
       "worlds/rock.json",
-	    "worlds/small.json"
+	    "worlds/ice.json"
   ]
 }