Parcourir la source

Heightmap fix, texture fix, rotating crystals and enemy height to 0

Dofensmirtsz il y a 9 ans
Parent
commit
6306e8abd4
6 fichiers modifiés avec 7 ajouts et 3 suppressions
  1. 4 0
      Crystal.cpp
  2. 1 1
      Crystal.h
  3. 1 1
      HeightMap.cpp
  4. 1 1
      World.cpp
  5. BIN
      worlds/rockHeightmap.png
  6. BIN
      worlds/rockStone.png

+ 4 - 0
Crystal.cpp

@@ -18,6 +18,8 @@ Crystal::Crystal(const std::string & filled, const std::string & empty, const Ve
 	sound_id = CrystalPoint::GetSoundSystem().LoadSound("WAVE/Crystal.wav", false);
 	music = CrystalPoint::GetSoundSystem().GetSound(sound_id);
 	music->SetPos(position, Vec3f());
+
+	crystalRot = 0;
 }
 
 Crystal::~Crystal()
@@ -38,6 +40,8 @@ Crystal::~Crystal()
 
 void Crystal::draw()
 {	
+	crystalRot -= 3.0f;
+	rotation = Vec3f(0, crystalRot, 0);
 	Entity::draw();	
 }
 

+ 1 - 1
Crystal.h

@@ -10,7 +10,7 @@ public:
 	Crystal(const std::string &filled, const std::string &empty,
 		const Vec3f &position, Vec3f &rotation, const float &scale);
 	~Crystal();
-
+	float crystalRot;
 	bool isFilled;
 	void draw();
 	void collide();

+ 1 - 1
HeightMap.cpp

@@ -49,7 +49,7 @@ HeightMap::HeightMap(const std::string &file, World* world)
 		{
 			int offsets[4][2] = { { 0, 0 },{ 1, 0 },{ 1, 1 },{ 0, 1 } };
 
-			if (valueAt(x, y, GREEN) > 0)
+			if (valueAt(x, y, GREEN) > 5)
 			{
 				world->addLevelObject(new LevelObject(world->getObjectFromValue(valueAt(x, y, GREEN)).first, Vec3f(x, heightAt(x, y), y), Vec3f(0, 0, 0), 1, world->getObjectFromValue(valueAt(x, y, GREEN)).second));
 			}

+ 1 - 1
World.cpp

@@ -319,7 +319,7 @@ void World::update(float elapsedTime)
 				continue;
 			}
 		}
-		enemy->position.y = getHeight(enemy->position.x, enemy->position.z) + 2.0f;
+		enemy->position.y = getHeight(enemy->position.x, enemy->position.z);
 		
 		if(!remove)
 			count++;

BIN
worlds/rockHeightmap.png


BIN
worlds/rockStone.png