Merged with master and fixed some small variable things
This commit is contained in:
@@ -24,7 +24,8 @@
|
|||||||
#include "Physics/ECreateParticleSequence.h"
|
#include "Physics/ECreateParticleSequence.h"
|
||||||
#include "Physics/CCircleShape.h"
|
#include "Physics/CCircleShape.h"
|
||||||
#include "Physics/CParticleEmitter.h"
|
#include "Physics/CParticleEmitter.h"
|
||||||
#include "Game/Bricks/CPowerUpBrick.h"
|
|
||||||
|
#include "Game/BrickComponents.h"
|
||||||
|
|
||||||
#include "Transform/TransformSystem.h"
|
#include "Transform/TransformSystem.h"
|
||||||
#include "Transform/TransformSystem.h"
|
#include "Transform/TransformSystem.h"
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ void dd::Systems::LevelSystem::GetNextLevel()
|
|||||||
1, 0, 1, 2, 1, 0, 1,
|
1, 0, 1, 2, 1, 0, 1,
|
||||||
0, 1, 0, 1, 0, 1, 0,
|
0, 1, 0, 1, 0, 1, 0,
|
||||||
1, 0, 1, 0, 1, 0, 1,
|
1, 0, 1, 0, 1, 0, 1,
|
||||||
2, 3, 4, 5, 6, 0, 0};
|
0, 0, 0, 0, 0, 0, 0};
|
||||||
color =
|
color =
|
||||||
{w, w, w, w, w, w, w,
|
{w, w, w, w, w, w, w,
|
||||||
lb4, lb4, lb4, lb4, lb4, lb4, lb4,
|
lb4, lb4, lb4, lb4, lb4, lb4, lb4,
|
||||||
|
|||||||
@@ -688,10 +688,12 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
|
|||||||
{
|
{
|
||||||
//Check if it is a brick colliding
|
//Check if it is a brick colliding
|
||||||
auto brick = m_World->GetComponent<Components::Brick>(event.Entity1);
|
auto brick = m_World->GetComponent<Components::Brick>(event.Entity1);
|
||||||
|
EntityID entity = event.Entity1;
|
||||||
Components::Model* model;
|
Components::Model* model;
|
||||||
|
|
||||||
if (!brick) {
|
if (!brick) {
|
||||||
brick = m_World->GetComponent<Components::Brick>(event.Entity2);
|
brick = m_World->GetComponent<Components::Brick>(event.Entity2);
|
||||||
|
EntityID entity = event.Entity2;
|
||||||
if (!brick) {
|
if (!brick) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -717,9 +719,25 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
|
|||||||
e.Color = glm::vec4(1.f);
|
e.Color = glm::vec4(1.f);
|
||||||
e.Radius = 1.f;
|
e.Radius = 1.f;
|
||||||
e.Speed = 0;
|
e.Speed = 0;
|
||||||
|
|
||||||
if (brick->Type == 1 || brick->Type == 0)
|
auto PowerFriend = m_World->GetComponent<Components::MultiBallBrick>(entity);
|
||||||
{
|
auto PowerSaviour = m_World->GetComponent<Components::LifebuoyBrick>(entity);
|
||||||
|
auto PowerSticky = m_World->GetComponent<Components::StickyBrick>(entity);
|
||||||
|
auto PowerInkBlaster = m_World->GetComponent<Components::InkBlasterBrick>(entity);
|
||||||
|
auto PowerKraken = m_World->GetComponent<Components::KrakenAttackBrick>(entity);
|
||||||
|
|
||||||
|
if (PowerFriend) {
|
||||||
|
e.SpriteFile = "Textures/PowerUps/Friends.png";
|
||||||
|
} else if (PowerSaviour) {
|
||||||
|
e.SpriteFile = "Textures/PowerUps/Saviour.png";
|
||||||
|
} else if (PowerSticky) {
|
||||||
|
e.SpriteFile = "Textures/PowerUps/Sticky.png";
|
||||||
|
} else if (PowerInkBlaster){
|
||||||
|
e.SpriteFile = "Textures/PowerUps/InkBlaster.png";
|
||||||
|
} else if (PowerKraken) {
|
||||||
|
e.SpriteFile = "Textures/PowerUps/RealeaseTheKraken.png";
|
||||||
|
}
|
||||||
|
else {
|
||||||
e.EmitterLifeTime = 4;
|
e.EmitterLifeTime = 4;
|
||||||
e.EmittingAngle = glm::half_pi<float>();
|
e.EmittingAngle = glm::half_pi<float>();
|
||||||
e.Spread = 0.5f;
|
e.Spread = 0.5f;
|
||||||
@@ -731,18 +749,8 @@ bool dd::Systems::PhysicsSystem::OnContact(const dd::Events::Contact &event)
|
|||||||
e.SpriteFile = "Textures/Particles/Cloud_Particle.png";
|
e.SpriteFile = "Textures/Particles/Cloud_Particle.png";
|
||||||
e.Color = model->Color + glm::vec4(0.5f);
|
e.Color = model->Color + glm::vec4(0.5f);
|
||||||
e.Speed = 100;
|
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);
|
EventBroker->Publish(e);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user