Power up sprites now show when you hit powerup bricks

This commit is contained in:
tleety
2015-10-12 16:48:04 +02:00
parent 3fef91b8a9
commit 52e2ce567a
6 changed files with 42 additions and 10 deletions

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

+1
View File
@@ -16,6 +16,7 @@ namespace Components
struct Brick : Component
{
int Score = 50;
//0 = empty, 1 = normal, 2 = multi-brick, 3 = lifebuoy, 4 = sticky, 5 = blaster, 6 = kraken
int Type = 0;
bool Removed = false;
};
+1
View File
@@ -24,6 +24,7 @@
#include "Physics/ECreateParticleSequence.h"
#include "Physics/CCircleShape.h"
#include "Physics/CParticleEmitter.h"
#include "Game/Bricks/CPowerUpBrick.h"
#include "Transform/TransformSystem.h"
#include "Transform/TransformSystem.h"
+1 -1
View File
@@ -598,7 +598,7 @@ void dd::Systems::LevelSystem::GetNextLevel()
1, 0, 1, 2, 1, 0, 1,
0, 1, 0, 1, 0, 1, 0,
1, 0, 1, 0, 1, 0, 1,
0, 0, 0, 0, 0, 0, 0};
2, 3, 4, 5, 6, 0, 0};
color =
{w, w, w, w, w, w, w,
lb4, lb4, lb4, lb4, lb4, lb4, lb4,
+39 -9
View File
@@ -702,21 +702,51 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
else {
model = m_World->GetComponent<Components::Model>(event.Entity1);
}
//Spawn a particle when a brick collides with somthing
Events::CreateParticleSequence e;
e.EmitterLifeTime = 4;
//- glm::atan(event.Normal.x, event.Normal.y
e.EmitterLifeTime = 3;
e.EmittingAngle = glm::half_pi<float>();
e.Spread = 0.5f;
e.Spread = 0.f;
e.NumberOfTicks = 1;
e.ParticleLifeTime = 1.f;
e.ParticlesPerTick = 15;
e.Position = glm::vec3(event.IntersectionPoint.x, event.IntersectionPoint.y, -10);
e.Radius = 0.2f;
e.SpriteFile = "Textures/Particles/Cloud_Particle.png";
e.Color = model->Color + glm::vec4(0.5f);
e.Speed = 100;
e.ParticlesPerTick = 1;
e.Position = glm::vec3(event.IntersectionPoint.x, event.IntersectionPoint.y, -7);
e.Color = glm::vec4(1.f);
e.Radius = 1.f;
e.Speed = 0;
if (brick->Type == 1 || brick->Type == 0)
{
e.EmitterLifeTime = 4;
e.EmittingAngle = glm::half_pi<float>();
e.Spread = 0.5f;
e.NumberOfTicks = 1;
e.ParticleLifeTime = 1.f;
e.ParticlesPerTick = 15;
e.Position = glm::vec3(event.IntersectionPoint.x, event.IntersectionPoint.y, -10);
e.Radius = 0.2f;
e.SpriteFile = "Textures/Particles/Cloud_Particle.png";
e.Color = model->Color + glm::vec4(0.5f);
e.Speed = 100;
} else if (brick->Type == 2) {
e.SpriteFile = "Textures/PowerUps/Friends.png";
} else if (brick->Type == 3) {
e.SpriteFile = "Textures/PowerUps/Saviour.png";
} else if (brick->Type == 4) {
e.SpriteFile = "Textures/PowerUps/Sticky.png";
} else if (brick->Type == 5) {
e.SpriteFile = "Textures/PowerUps/InkBlaster.png";
} else if (brick->Type == 6) {
e.SpriteFile = "Textures/PowerUps/RealeaseTheKraken.png";
}
EventBroker->Publish(e);
return true;
}