Implemented Combos which multiply score. Adjusted pad a bit.

This commit is contained in:
PlatinumSkink
2015-09-29 14:42:01 +02:00
parent 94fc7c1ce6
commit c3b54ef030
11 changed files with 137 additions and 57 deletions
+2 -2
View File
@@ -150,8 +150,8 @@ public:
physics->Mask = CollisionLayer::Type::Pad | CollisionLayer::Type::Brick | CollisionLayer::Type::Wall;
physics->Calculate = true;
auto plight = m_World->AddComponent<Components::PointLight>(ent);
plight->Radius = 2.f;
//auto plight = m_World->AddComponent<Components::PointLight>(ent);
//plight->Radius = 2.f;
m_World->CommitEntity(ent);
}
+14 -3
View File
@@ -5,6 +5,7 @@
#include "Core/World.h"
#include "Core/EventBroker.h"
#include "Core/CTransform.h"
#include "Core/CTemplate.h"
#include "Physics/CPhysics.h"
#include "Physics/CCircleShape.h"
#include "Physics/EContact.h"
@@ -12,17 +13,22 @@
#include "Rendering/CPointLight.h"
#include "Game/CBall.h"
#include "Game/CPowerUp.h"
#include "Game/CLife.h"
#include "Game/ELifeLost.h"
#include "Game/EComboEvent.h"
#include "Game/EResetBall.h"
#include "Game/EMultiBall.h"
#include "Game/EMultiBallLost.h"
#include "Game/EGameOver.h"
namespace dd {
namespace dd
{
namespace Systems {
namespace Systems
{
class BallSystem : public System {
class BallSystem : public System
{
public:
BallSystem(World *world, std::shared_ptr<dd::EventBroker> eventBroker)
: System(world, eventBroker) { }
@@ -49,9 +55,12 @@ public:
void OnEntityRemoved(EntityID entity) override;
EntityID CreateBall();
void CreateLife(int);
EntityID Ball() { return m_Ball; };
void SetBall(const EntityID& ball) { m_Ball = ball; }
float& XMovementMultiplier() { return m_XMovementMultiplier; }
void SetXMovementMultiplier(const float& xMovementMultiplier) { m_XMovementMultiplier = xMovementMultiplier; }
float& EdgeX() { return m_EdgeX; }
void SetEdgeX(const float& edgeX) { m_EdgeX = edgeX; }
float& EdgeY() { return m_EdgeY; }
@@ -68,6 +77,7 @@ public:
void SetMultiBall(const bool& multiBall) { m_MultiBall = multiBall; }
private:
float m_XMovementMultiplier = 2.f;
float m_EdgeX = 3.2f;
float m_EdgeY = 5.2f;
int m_MultiBalls = 0;
@@ -90,6 +100,7 @@ private:
};
}
}
#endif
+1
View File
@@ -17,6 +17,7 @@ struct Ball : Component
{
int Number = 0;
float Speed = 5.f;
int Combo = 0;
};
}
+1 -1
View File
@@ -22,7 +22,7 @@ struct Pad : Component
float SlowdownModifier = 5.f;
float AccelerationSpeed = 40.f;
float MaxSpeed = 20.f;
float MaxSpeed = 5.f;
};
}
+27
View File
@@ -0,0 +1,27 @@
//
// Created by Adniklastrator on 2015-09-29.
//
#ifndef DAYDREAM_ECOMBOEVENT_H
#define DAYDREAM_ECOMBOEVENT_H
#include "Core/Entity.h"
#include "Core/EventBroker.h"
namespace dd
{
namespace Events
{
struct ComboEvent : Event
{
EntityID Ball;
int Combo;
};
}
}
#endif //DAYDREAM_ECOMBOEVENT_H
+3 -2
View File
@@ -7,6 +7,7 @@
#include "Core/System.h"
#include "Core/CTransform.h"
#include "Core/CTemplate.h"
#include "Core/EventBroker.h"
#include "Core/World.h"
#include "Rendering/CSprite.h"
@@ -19,7 +20,7 @@
#include "Game/ELifeLost.h"
#include "Game/EResetBall.h"
#include "Game/EScoreEvent.h"
#include "Physics/CRectangleShape.h"
#include "Game/EComboEvent.h"
#include "Game/EMultiBall.h"
#include "Game/EMultiBallLost.h"
#include "Game/EGameOver.h"
@@ -28,6 +29,7 @@
#include "Game/Bricks/CPowerUpBrick.h"
#include "Physics/CPhysics.h"
#include "Physics/CCircleShape.h"
#include "Physics/CRectangleShape.h"
#include "Physics/ESetImpulse.h"
#include "Physics/EContact.h"
#include "Sound/CCollisionSound.h"
@@ -62,7 +64,6 @@ public:
void Initialize() override;
void CreateBasicLevel(int, int, glm::vec2, float);
void CreateLife(int);
void SaveLevel(int, int, glm::vec2, int); // Shouldn't be here, but I'm experimenting.
void LoadLevel(char[20]);
void CreateBrick(int, int, glm::vec2, float, int);
+1
View File
@@ -9,6 +9,7 @@
#include "Core/System.h"
#include "Core/Component.h"
#include "Core/CTransform.h"
#include "Core/CTemplate.h"
#include "Core/EventBroker.h"
#include "Core/EKeyDown.h"
#include "Core/EKeyUp.h"