CPowerUpBrick + CPowerUp exists. Can drop from brick and be grabbed for MultiBall.

This commit is contained in:
PlatinumSkink
2015-09-22 17:55:12 +02:00
parent 2797a0f6c3
commit f6b6f05c37
10 changed files with 275 additions and 33 deletions
+25
View File
@@ -0,0 +1,25 @@
//
// Created by Administrator on 2015-09-22.
//
#ifndef DAYDREAM_CPOWERUPBRICK_H
#define DAYDREAM_CPOWERUPBRICK_H
#include "Core/Component.h"
namespace dd
{
namespace Components
{
struct PowerUpBrick : Component
{
};
}
}
#endif //DAYDREAM_CPOWERUPBRICK_H
+25
View File
@@ -0,0 +1,25 @@
//
// Created by Administrator on 2015-09-22.
//
#ifndef DAYDREAM_CPOWERUP_H
#define DAYDREAM_CPOWERUP_H
#include "Core/Component.h"
namespace dd
{
namespace Components
{
struct PowerUp : Component
{
int Type;
};
}
}
#endif //DAYDREAM_CPOWERUP_H
+26
View File
@@ -0,0 +1,26 @@
//
// Created by Administrator on 2015-09-22.
//
#ifndef DAYDREAM_ECREATEPOWERUP_H
#define DAYDREAM_ECREATEPOWERUP_H
#include "Core/EventBroker.h"
namespace dd
{
namespace Events
{
struct CreatePowerUp : Event
{
glm::vec3 Position;
};
}
}
#endif //DAYDREAM_ECREATEPOWERUP_H
+27
View File
@@ -0,0 +1,27 @@
//
// Created by Administrator on 2015-09-22.
//
#ifndef DAYDREAM_EGAMEOVER_H
#define DAYDREAM_EGAMEOVER_H
#include "Core/EventBroker.h"
#include "Core/Entity.h"
namespace dd
{
namespace Events
{
struct GameOver : Event
{
EntityID Entity;
};
}
}
#endif //DAYDREAM_EGAMEOVER_H
+15 -5
View File
@@ -7,24 +7,29 @@
#include "Core/System.h"
#include "Core/CTransform.h"
#include "Core/EventBroker.h"
#include "Core/World.h"
#include "Rendering/CSprite.h"
#include "Rendering/CModel.h"
#include "Game/CBrick.h"
#include "Core/EventBroker.h"
#include "Core/World.h"
#include "Game/CBall.h"
#include "Game/CLife.h"
#include "Game/CPowerUp.h"
#include "Game/EStageCleared.h"
#include "Game/ELifeLost.h"
#include "Game/EResetBall.h"
#include "Game/EScoreEvent.h"
#include "Game/EMultiBall.h"
#include "Game/EGameOver.h"
#include "Game/ECreatePowerUp.h"
#include "Game/Bricks/CPowerUpBrick.h"
#include "Physics/CBoxShape.h"
#include "Physics/CPhysics.h"
#include "Physics/CCircleShape.h"
#include "Physics/ESetImpulse.h"
#include "Physics/EContact.h"
#include "Sound/CCollisionSound.h"
#include "Game/PadSystem.h"
#include <fstream>
#include <iostream>
#include <intrin.h>
@@ -75,6 +80,8 @@ public:
void SetLives(const int& lives) { m_Lives = lives; }
int& PastLives() { return m_PastLives; }
void SetPastLives(const int& pastLives) { m_PastLives = pastLives; }
int& MultiBalls() { return m_MultiBalls; }
void SetMultiBalls(const int& multiBalls) { m_MultiBalls = multiBalls; }
int& Score() { return m_Score; }
void SetScore(const int& score) { m_Score = score; }
int& NumberOfBricks() { return m_NumberOfBricks; }
@@ -93,6 +100,7 @@ private:
bool m_Initialized = false;
int m_Lives = 3;
int m_PastLives = 3;
int m_MultiBalls = 0;
int m_Score = 0;
int m_NumberOfBricks;
int m_Rows = 7;
@@ -104,11 +112,13 @@ private:
dd::EventRelay<LevelSystem, dd::Events::LifeLost> m_ELifeLost;
dd::EventRelay<LevelSystem, dd::Events::ScoreEvent> m_EScoreEvent;
dd::EventRelay<LevelSystem, dd::Events::MultiBall> m_EMultiBall;
dd::EventRelay<LevelSystem, dd::Events::CreatePowerUp> m_ECreatePowerUp;
bool OnContact(const dd::Events::Contact &event);
bool LifeLost(const dd::Events::LifeLost &event);
bool ScoreEvent(const dd::Events::ScoreEvent &event);
bool MultiBall(const dd::Events::MultiBall &event);
bool OnLifeLost(const dd::Events::LifeLost &event);
bool OnScoreEvent(const dd::Events::ScoreEvent &event);
bool OnMultiBall(const dd::Events::MultiBall &event);
bool OnCreatePowerUp(const dd::Events::CreatePowerUp &event);
};
}
+4 -1
View File
@@ -21,8 +21,9 @@
#include "Rendering/CSprite.h"
#include "Rendering/CModel.h"
#include "Game/CBall.h"
#include "Game/EResetBall.h"
#include "Game/CPad.h"
#include "Game/CPowerUp.h"
#include "Game/EResetBall.h"
#include "Game/EMultiBall.h"
@@ -73,6 +74,7 @@ private:
dd::EventRelay<PadSystem, dd::Events::KeyDown> m_EKeyDown;
dd::EventRelay<PadSystem, dd::Events::KeyUp> m_EKeyUp;
dd::EventRelay<PadSystem, dd::Events::Contact> m_EContact;
dd::EventRelay<PadSystem, dd::Events::Contact> m_EContactPowerUp;
dd::EventRelay<PadSystem, dd::Events::ResetBall> m_EResetBall;
dd::EventRelay<PadSystem, dd::Events::MultiBall> m_EMultiBall;
@@ -80,6 +82,7 @@ private:
bool OnKeyUp(const dd::Events::KeyUp &event);
bool OnContact(const dd::Events::Contact &event);
bool OnContactPowerUp(const dd::Events::Contact &event);
bool OnResetBall(const dd::Events::ResetBall &event);
bool OnMultiBall(const dd::Events::MultiBall &event);