MusicIncluded, crystals

This commit is contained in:
Aaldert
2016-06-21 17:10:34 +02:00
parent eadfea9d63
commit d56625e19a
8 changed files with 29 additions and 9 deletions
+7 -2
View File
@@ -7,18 +7,22 @@ Crystal::Crystal(const std::string & filled, const std::string & empty, const Ve
{
this->filled = Model::load(filled);
this->empty = Model::load(empty);
model = this->filled;
model = this->filled;
this->position = position;
this->rotation = rotation;
this->scale = scale;
this->canCollide = true;
isFilled = true;
sound_id = CrystalPoint::GetSoundSystem().LoadSound("WAVE/Crystal.wav", false);
music = CrystalPoint::GetSoundSystem().GetSound(sound_id);
music->SetPos(position, Vec3f());
}
Crystal::~Crystal()
{
CrystalPoint::GetSoundSystem().UnloadSound(sound_id);
if (model)
Model::unload(model);
@@ -41,6 +45,7 @@ void Crystal::collide()
{
if (isFilled)
{
music->Play();
Player::getInstance()->crystals++;
isFilled = false;
model = empty;
+3
View File
@@ -1,6 +1,7 @@
#pragma once
#include "Entity.h"
#include <string>
#include "CrystalPoint.h"
class Crystal :
public Entity
@@ -14,6 +15,8 @@ public:
void draw();
void collide();
private:
int sound_id;
Sound* music;
Model* filled;
Model* empty;
};
+5 -2
View File
@@ -216,8 +216,11 @@
<None Include="worlds\worlds.json" />
</ItemGroup>
<ItemGroup>
<Media Include="WAVE\bond.wav" />
<Media Include="WAVE\Sound.wav" />
<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" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
+11 -2
View File
@@ -204,10 +204,19 @@
</None>
</ItemGroup>
<ItemGroup>
<Media Include="WAVE\Sound.wav">
<Media Include="WAVE\Crystal.wav">
<Filter>Resource Files</Filter>
</Media>
<Media Include="WAVE\bond.wav">
<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">
<Filter>Resource Files</Filter>
</Media>
<Media Include="WAVE\test2.wav">
<Filter>Resource Files</Filter>
</Media>
</ItemGroup>
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+3 -3
View File
@@ -24,17 +24,17 @@
"file": "models/squid/Blooper.obj",
"pos": [ 20, 5, 10 ],
"scale": 0.01,
"music": "WAVE/enemy.wav"
"music": "WAVE/ghostEnemy.wav"
},
{
"file": "models/squid/Blooper.obj",
"pos": [ 30, 10, 10 ],
"scale": 0.01,
"music": "WAVE/enemy.wav"
"music": "WAVE/ghostEnemy.wav"
}],
"crystal": {
"full texture": "models/crystal/Crystal.obj",
"empty texture": "models/crystal/PickedUpCrystal.obj",
"empty texture": "models/crystal/PickedUpCrystal.obj",
"instances": [
{
"pos": [ 31, 5, 33 ],