Quellcode durchsuchen

Muziek toegvoegt aan world en enemy

Aaldert vor 9 Jahren
Ursprung
Commit
9543dd8324
9 geänderte Dateien mit 12 neuen und 18 gelöschten Zeilen
  1. 1 2
      CrystalPoint.vcxproj
  2. 2 5
      CrystalPoint.vcxproj.filters
  3. 1 7
      Enemy.cpp
  4. BIN
      WAVE/ghostEnemy.wav
  5. BIN
      WAVE/test1.wav
  6. BIN
      WAVE/world1.wav
  7. 5 1
      World.cpp
  8. 2 2
      worlds/rock.json
  9. 1 1
      worlds/small.json

+ 1 - 2
CrystalPoint.vcxproj

@@ -219,8 +219,7 @@
     <Media Include="WAVE\Crystal.wav" />
     <Media Include="WAVE\ghostEnemy.wav" />
     <Media Include="WAVE\portal.wav" />
-    <Media Include="WAVE\test1.wav" />
-    <Media Include="WAVE\test2.wav" />
+    <Media Include="WAVE\world1.wav" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">

+ 2 - 5
CrystalPoint.vcxproj.filters

@@ -207,16 +207,13 @@
     <Media Include="WAVE\Crystal.wav">
       <Filter>Resource Files</Filter>
     </Media>
-    <Media Include="WAVE\ghostEnemy.wav">
-      <Filter>Resource Files</Filter>
-    </Media>
     <Media Include="WAVE\portal.wav">
       <Filter>Resource Files</Filter>
     </Media>
-    <Media Include="WAVE\test1.wav">
+    <Media Include="WAVE\ghostEnemy.wav">
       <Filter>Resource Files</Filter>
     </Media>
-    <Media Include="WAVE\test2.wav">
+    <Media Include="WAVE\world1.wav">
       <Filter>Resource Files</Filter>
     </Media>
   </ItemGroup>

+ 1 - 7
Enemy.cpp

@@ -27,10 +27,9 @@ Enemy::Enemy(const std::string &fileName,
 
 Enemy::~Enemy()
 {
+	CrystalPoint::GetSoundSystem().UnloadSound(hit_sound_id);
 	if (model)
 		Model::unload(model);
-
-	CrystalPoint::GetSoundSystem().UnloadSound(hit_sound_id);
 }
 
 void Enemy::draw()
@@ -106,11 +105,6 @@ void Enemy::update(float delta)
 		else
 		{	
 			attack = true;
-			if (music->IsPlaying() == true)
-			{
-//				music->Pause();
-				music->Stop();
-			}
 		}
 
 		rotation.y = atan2f(dx, dz) * 180 / M_PI;		

BIN
WAVE/ghostEnemy.wav


BIN
WAVE/test1.wav


BIN
WAVE/test2.wav → WAVE/world1.wav


+ 5 - 1
World.cpp

@@ -314,8 +314,12 @@ void World::update(float elapsedTime)
 			count++;
 	}
 
-	if(remove)
+	if (remove)
+	{
+		delete enemies[count];
 		enemies.erase(enemies.begin() + count);
+	}
+
 
 	skybox->update(elapsedTime, maxEnemies - enemies.size(), maxEnemies);
 

+ 2 - 2
worlds/rock.json

@@ -3,7 +3,7 @@
     "heightmap": "worlds/rockHeightmap.png",
     "texture": "worlds/rockStone2.png",
 	"skybox": "skyboxes/water/",
-	"music":  "WAVE/test2.wav",
+	"music":  "WAVE/world1.wav",
     "object-templates": [
       {
         "color": 50,
@@ -95,7 +95,7 @@
       "file": "models/squid/Blooper.obj",
       "pos": [ 20, 5, 10 ],
       "scale": 0.01,
-      "music": "WAVE/enemy.wav"
+      "music": "WAVE/ghostEnemy.wav"
   }],
   "crystal": {
     "full texture": "models/crystal/Crystal.obj",

+ 1 - 1
worlds/small.json

@@ -9,7 +9,7 @@
         "collision": true
       }
     ],
-	"music": "WAVE/test1.wav"
+	"music": "WAVE/world1.wav"
   },
   "player": {
     "startposition": [ 20, 5, 20 ]