Merge remote-tracking branch 'origin/master' into LevelSystemAndSuch
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
@@ -35,6 +35,7 @@
|
|||||||
#include "Game/EHitLag.h"
|
#include "Game/EHitLag.h"
|
||||||
#include "Game/EActionButton.h"
|
#include "Game/EActionButton.h"
|
||||||
#include "Game/ELifebuoyHit.h"
|
#include "Game/ELifebuoyHit.h"
|
||||||
|
#include "Physics/ECreateParticleSequence.h"
|
||||||
|
|
||||||
namespace dd
|
namespace dd
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,8 +26,14 @@ public:
|
|||||||
Width = parent->Width;
|
Width = parent->Width;
|
||||||
Height = parent->Height;
|
Height = parent->Height;
|
||||||
|
|
||||||
m_ScoreBackground = new GUI::TextureFrame(this, "HUDScoreBackgroundFrame");
|
m_ScoreBackMid = new GUI::TextureFrame(this, "HUDScoreBackgroundFrame");
|
||||||
m_ScoreBackground->SetTexture("Textures/GUI/Numbers/Background.png");
|
m_ScoreBackMid->SetTexture("Textures/GUI/Numbers/ScoreBackgroundMid.png");
|
||||||
|
|
||||||
|
m_ScoreBackLeft = new GUI::TextureFrame(this, "HUDScoreBackgroundLeftFrame");
|
||||||
|
m_ScoreBackLeft->SetTexture("Textures/GUI/Numbers/ScoreBackgroundLeft.png");
|
||||||
|
|
||||||
|
m_ScoreBackRight = new GUI::TextureFrame(this, "HUDScoreBackgroundRightFrame");
|
||||||
|
m_ScoreBackRight->SetTexture("Textures/GUI/Numbers/ScoreBackgroundRight.png");
|
||||||
m_ScoreNumberFrame = new GUI::NumberFrame(this, "HUDScoreNumberFrame");
|
m_ScoreNumberFrame = new GUI::NumberFrame(this, "HUDScoreNumberFrame");
|
||||||
//m_ScoreNumberFrame->X = 15;
|
//m_ScoreNumberFrame->X = 15;
|
||||||
m_ScoreNumberFrame->Y = 18;
|
m_ScoreNumberFrame->Y = 18;
|
||||||
@@ -52,7 +58,9 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TextureFrame* m_ScoreBackground = nullptr;
|
TextureFrame* m_ScoreBackMid = nullptr;
|
||||||
|
TextureFrame* m_ScoreBackLeft = nullptr;
|
||||||
|
TextureFrame* m_ScoreBackRight = nullptr;
|
||||||
NumberFrame* m_ScoreNumberFrame = nullptr;
|
NumberFrame* m_ScoreNumberFrame = nullptr;
|
||||||
FPSCounter* m_FPSCounter = nullptr;
|
FPSCounter* m_FPSCounter = nullptr;
|
||||||
TextureFrame* m_GameOverFrame = nullptr;
|
TextureFrame* m_GameOverFrame = nullptr;
|
||||||
@@ -67,9 +75,18 @@ private:
|
|||||||
void updateScore()
|
void updateScore()
|
||||||
{
|
{
|
||||||
m_ScoreNumberFrame->SetLeft(Width / 2.f - m_ScoreNumberFrame->Width / 2.f);
|
m_ScoreNumberFrame->SetLeft(Width / 2.f - m_ScoreNumberFrame->Width / 2.f);
|
||||||
m_ScoreBackground->SetLeft(m_ScoreNumberFrame->Left() - 20);
|
|
||||||
m_ScoreBackground->Width = m_ScoreNumberFrame->Width + 40;
|
m_ScoreBackMid->SetLeft(m_ScoreNumberFrame->Left());
|
||||||
m_ScoreBackground->Height = m_ScoreNumberFrame->Height + 30;
|
m_ScoreBackMid->Width = m_ScoreNumberFrame->Width;
|
||||||
|
m_ScoreBackMid->Height = m_ScoreNumberFrame->Height + 35;
|
||||||
|
|
||||||
|
m_ScoreBackLeft->SetRight(m_ScoreBackMid->Left());
|
||||||
|
m_ScoreBackLeft->Width = 40;
|
||||||
|
m_ScoreBackLeft->Height = m_ScoreBackMid->Height;
|
||||||
|
|
||||||
|
m_ScoreBackRight->SetLeft(m_ScoreBackMid->Right());
|
||||||
|
m_ScoreBackRight->Width = 40;
|
||||||
|
m_ScoreBackRight->Height = m_ScoreBackMid->Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnScore(const Events::ScoreEvent& event)
|
bool OnScore(const Events::ScoreEvent& event)
|
||||||
|
|||||||
@@ -57,9 +57,6 @@ namespace dd
|
|||||||
|
|
||||||
~PhysicsSystem();
|
~PhysicsSystem();
|
||||||
|
|
||||||
EventRelay<PhysicsSystem, Events::CreateParticleSequence> m_ECreateParticleSequence;
|
|
||||||
bool CreateParticleSequence(const Events::CreateParticleSequence &event);
|
|
||||||
|
|
||||||
void RegisterComponents(ComponentFactory* cf) override;
|
void RegisterComponents(ComponentFactory* cf) override;
|
||||||
void Initialize() override;
|
void Initialize() override;
|
||||||
void Update(double dt) override;
|
void Update(double dt) override;
|
||||||
@@ -116,6 +113,8 @@ namespace dd
|
|||||||
bool OnPause(const dd::Events::Pause &event);
|
bool OnPause(const dd::Events::Pause &event);
|
||||||
dd::EventRelay<PhysicsSystem, dd::Events::Contact> m_EContact;
|
dd::EventRelay<PhysicsSystem, dd::Events::Contact> m_EContact;
|
||||||
bool OnContact(const dd::Events::Contact &event);
|
bool OnContact(const dd::Events::Contact &event);
|
||||||
|
EventRelay<PhysicsSystem, Events::CreateParticleSequence> m_ECreateParticleSequence;
|
||||||
|
bool CreateParticleSequence(const Events::CreateParticleSequence &event);
|
||||||
|
|
||||||
//TODO: Fill struct with info needed.
|
//TODO: Fill struct with info needed.
|
||||||
struct EmitterHandler //TODO CHANGE NAMES
|
struct EmitterHandler //TODO CHANGE NAMES
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ void dd::Systems::BallSystem::Initialize()
|
|||||||
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &BallSystem::OnStageCleared);
|
EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &BallSystem::OnStageCleared);
|
||||||
EVENT_SUBSCRIBE_MEMBER(m_EArrivedAtNewStage, &BallSystem::OnArrivedToNewStage);
|
EVENT_SUBSCRIBE_MEMBER(m_EArrivedAtNewStage, &BallSystem::OnArrivedToNewStage);
|
||||||
|
|
||||||
|
|
||||||
//OctoBall
|
//OctoBall
|
||||||
{
|
{
|
||||||
auto ent = m_World->CreateEntity();
|
auto ent = m_World->CreateEntity();
|
||||||
@@ -291,7 +292,41 @@ bool dd::Systems::BallSystem::Contact(const Events::Contact &event)
|
|||||||
float x = (ballTransform->Position.x - padTransform->Position.x) * XMovementMultiplier();
|
float x = (ballTransform->Position.x - padTransform->Position.x) * XMovementMultiplier();
|
||||||
float y = glm::cos((abs(x) / (1.6f)) * glm::pi<float>() / 2.f) + 1.f;
|
float y = glm::cos((abs(x) / (1.6f)) * glm::pi<float>() / 2.f) + 1.f;
|
||||||
|
|
||||||
ballComponent->Combo = 0;
|
//When a combo is more than 2 create a particle showing it.
|
||||||
|
if (ballComponent->Combo >= 2){
|
||||||
|
|
||||||
|
Events::CreateParticleSequence particleEvent;
|
||||||
|
|
||||||
|
particleEvent.EmitterLifeTime = 3;
|
||||||
|
particleEvent.EmittingAngle = glm::half_pi<float>();
|
||||||
|
particleEvent.Spread = 0.f;
|
||||||
|
particleEvent.NumberOfTicks = 1;
|
||||||
|
particleEvent.ParticleLifeTime = 2.f;
|
||||||
|
particleEvent.ParticlesPerTick = 1;
|
||||||
|
particleEvent.Position = glm::vec3(ballTransform->Position.x, -3.f, -3.f);
|
||||||
|
if (ballTransform->Position.x >= 2.7f) {
|
||||||
|
particleEvent.Position = glm::vec3(2.7f, -3.f, -3.f);
|
||||||
|
} else if (ballTransform->Position.x <= -2.7f) {
|
||||||
|
particleEvent.Position = glm::vec3(-2.7f, -3.f, -3.f);
|
||||||
|
}
|
||||||
|
particleEvent.Radius = 1.f;
|
||||||
|
particleEvent.Color = glm::vec4(1.f);
|
||||||
|
particleEvent.Speed = 0;
|
||||||
|
|
||||||
|
if (ballComponent->Combo <= 9) {
|
||||||
|
particleEvent.SpriteFile = "Textures/Combo/Combo00" + std::to_string(ballComponent->Combo) + ".png";
|
||||||
|
} else if (ballComponent->Combo <= 42) {
|
||||||
|
particleEvent.SpriteFile = "Textures/Combo/Combo0" + std::to_string(ballComponent->Combo) + ".png";
|
||||||
|
} else {
|
||||||
|
particleEvent.SpriteFile = "Textures/Combo/Combo043.png";
|
||||||
|
}
|
||||||
|
EventBroker->Publish(particleEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ballComponent->Combo = 56;
|
||||||
if (!ballComponent->Waiting) {
|
if (!ballComponent->Waiting) {
|
||||||
if (m_InkBlaster) {
|
if (m_InkBlaster) {
|
||||||
if (!m_InkAttached) {
|
if (!m_InkAttached) {
|
||||||
|
|||||||