Quick-Fix for Score Error when additional frames appeared
This commit is contained in:
@@ -214,14 +214,14 @@ public:
|
||||
// m_World->CommitEntity(Pe);
|
||||
// }
|
||||
|
||||
// {
|
||||
// auto Pt = m_World->CreateEntity();
|
||||
// auto PtTransform = m_World->AddComponent<Components::Transform>(Pt);
|
||||
// auto PtSprite = m_World->AddComponent<Components::Sprite>(Pt);
|
||||
//
|
||||
// PtTransform->Position = glm::vec3(2.f, 0.f, -10.f);
|
||||
// PtSprite->SpriteFile = "Textures/Ball.png";
|
||||
// }
|
||||
{
|
||||
auto Pt = m_World->CreateEntity();
|
||||
auto PtTransform = m_World->AddComponent<Components::Transform>(Pt);
|
||||
auto PtSprite = m_World->AddComponent<Components::Sprite>(Pt);
|
||||
|
||||
PtTransform->Position = glm::vec3(2.f, 0.f, -10.f);
|
||||
PtSprite->SpriteFile = "Textures/Ball.png";
|
||||
}
|
||||
|
||||
//Water test
|
||||
{
|
||||
|
||||
+6
-6
@@ -44,9 +44,9 @@ public:
|
||||
: m_Name(name)
|
||||
{
|
||||
SetParent(parent);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &Frame::OnKeyDown);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &Frame::OnKeyUp);
|
||||
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Frame::OnCommand);
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &Frame::OnKeyDown);
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &Frame::OnKeyUp);
|
||||
//EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &Frame::OnCommand);
|
||||
}
|
||||
|
||||
~Frame()
|
||||
@@ -253,9 +253,9 @@ protected:
|
||||
virtual bool OnCommand(const Events::InputCommand& event) { return false; }
|
||||
|
||||
private:
|
||||
EventRelay<Frame, Events::KeyDown> m_EKeyDown;
|
||||
EventRelay<Frame, Events::KeyUp> m_EKeyUp;
|
||||
EventRelay<Frame, Events::InputCommand> m_EInputCommand;
|
||||
//EventRelay<Frame, Events::KeyDown> m_EKeyDown;
|
||||
//EventRelay<Frame, Events::KeyUp> m_EKeyUp;
|
||||
//EventRelay<Frame, Events::InputCommand> m_EInputCommand;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ public:
|
||||
m_A2 = new GUI::NumberFrame(m_LevelIndicator, "HUDScoreNumberFrameawdawdwa");
|
||||
m_A2->X = 60;
|
||||
m_A2->SetNumber(1);
|
||||
//m_A3 = new GUI::NumberFrame(m_LevelIndicator, "HUDScoreNumberFrameawdawdwa");
|
||||
//m_A3->X = 80;
|
||||
//m_A3->SetNumber(123);
|
||||
|
||||
m_ScoreIndicator = new GUI::TextureFrame(this, "HUDScoreIndicator");
|
||||
m_ScoreIndicator->SetTexture("Textures/GUI/HUD/ScoreIndicatorBG.png");
|
||||
@@ -49,6 +52,7 @@ private:
|
||||
TextureFrame* m_ScoreIndicator = nullptr;
|
||||
NumberFrame* m_A1 = nullptr;
|
||||
NumberFrame* m_A2 = nullptr;
|
||||
//NumberFrame* m_A3 = nullptr;
|
||||
NumberFrame* m_ScoreNumberFrame = nullptr;
|
||||
FPSCounter* m_FPSCounter = nullptr;
|
||||
|
||||
|
||||
@@ -246,10 +246,10 @@ bool dd::Systems::LevelSystem::OnContact(const dd::Events::Contact &event)
|
||||
es.Score = brick->Score * ball->Combo;
|
||||
EventBroker->Publish(es);
|
||||
|
||||
std::cout << "Combo: " << ball->Combo << std::endl;
|
||||
//std::cout << "Combo: " << ball->Combo << std::endl;
|
||||
//std::cout << NumberOfBricks() << std::endl;
|
||||
//std::cout << "Brick Score: " << brick->Score << std::endl;
|
||||
std::cout << "Score: " << Score() << std::endl;
|
||||
//std::cout << "Score: " << Score() << std::endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -257,7 +257,7 @@ bool dd::Systems::LevelSystem::OnContact(const dd::Events::Contact &event)
|
||||
|
||||
bool dd::Systems::LevelSystem::OnScoreEvent(const dd::Events::ScoreEvent &event)
|
||||
{
|
||||
SetScore(Score() += event.Score);
|
||||
//SetScore(Score() += event.Score);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user