Implimented the basis for Kraken encounter.

This commit is contained in:
PlatinumSkink
2015-10-15 15:08:05 +02:00
parent b2127c6c4e
commit bd59cd4108
8 changed files with 164 additions and 34 deletions
+6
View File
@@ -48,6 +48,7 @@
#include "Game/CProjectile.h"
#include "Game/CBrick.h"
#include "Game/CWall.h"
#include "Game/CKraken.h"
#include "Game/CBackground.h"
#include "Game/CTravels.h"
#include "Game/CStickyAim.h"
@@ -56,6 +57,7 @@
#include "Game/TravellingSystem.h"
#include "Game/LifebuoySystem.h"
#include "Game/ProjectileSystem.h"
#include "Game/KrakenSystem.h"
#include "Game/Bricks/CPowerUpBrick.h"
#include "Game/BrickComponents.h"
@@ -128,6 +130,7 @@ public:
m_World->ComponentFactory.Register<Components::Life>();
m_World->ComponentFactory.Register<Components::Lifebuoy>();
m_World->ComponentFactory.Register<Components::Projectile>();
m_World->ComponentFactory.Register<Components::Kraken>();
m_World->ComponentFactory.Register<Components::StickyAim>();
m_World->ComponentFactory.Register<Components::Travels>();
@@ -165,6 +168,9 @@ public:
m_World->SystemFactory.Register<Systems::TravellingSystem>(
[this]() { return new Systems::TravellingSystem(m_World.get(), m_EventBroker); });
m_World->AddSystem<Systems::TravellingSystem>();
m_World->SystemFactory.Register<Systems::KrakenSystem>(
[this]() { return new Systems::KrakenSystem(m_World.get(), m_EventBroker); });
m_World->AddSystem<Systems::KrakenSystem>();
m_World->ComponentFactory.Register<Components::Model>();
m_World->ComponentFactory.Register<Components::Template>();
+6 -6
View File
@@ -1,9 +1,9 @@
//
// Created by Adniklastrator on 2015-09-15.
// Created by Adniklastrator on 2015-10-15.
//
#ifndef DAYDREAM_CLIFE_H
#define DAYDREAM_CLIFE_H
#ifndef DAYDREAM_CKRAKEN_H
#define DAYDREAM_CKRAKEN_H
#include "Core/Component.h"
@@ -13,9 +13,9 @@ namespace dd
namespace Components
{
struct Life : Component {
struct Kraken : Component {
int Number = 0;
int Health = 10;
};
@@ -23,4 +23,4 @@ struct Life : Component {
}
#endif //DAYDREAM_CLIFE_H
#endif //DAYDREAM_CKRAKEN_H
+26
View File
@@ -0,0 +1,26 @@
//
// Created by Adniklastrator on 2015-10-15.
//
#ifndef DAYDREAM_EKRAKENAPPEAR_H
#define DAYDREAM_EKRAKENAPPEAR_H
#include "Core/EventBroker.h"
namespace dd
{
namespace Events
{
struct KrakenAppear : Event
{
int Health;
glm::vec3 Position;
};
}
}
#endif //DAYDREAM_EKRAKENAPPEAR_H
+14
View File
@@ -11,7 +11,16 @@
#include "Core/CTemplate.h"
#include "Core/EventBroker.h"
#include "Core/World.h"
#include "Rendering/CModel.h"
#include "Physics/CRectangleShape.h"
#include "Physics/CCircleShape.h"
#include "Physics/CPhysics.h"
#include "Game/EPause.h"
#include "Game/EKrakenAppear.h"
#include "Game/EKrakenAttack.h"
#include "Game/CTravels.h"
#include "Game/CKraken.h"
#include "Sound/CCollisionSound.h"
//#include "Core/Camera.h" Camera Component
@@ -37,9 +46,14 @@ public:
void SetPause(const bool& pause) { m_Pause = pause; }
private:
bool m_Pause = false;
EntityID m_KrakenTemplate;
dd::EventRelay<KrakenSystem, dd::Events::Pause> m_EPause;
dd::EventRelay<KrakenSystem, dd::Events::KrakenAppear> m_EKrakenAppear;
dd::EventRelay<KrakenSystem, dd::Events::KrakenAttack> m_EKrakenAttack;
bool OnPause(const dd::Events::Pause &event);
bool OnKrakenAppear(const dd::Events::KrakenAppear &event);
bool OnKrakenAttack(const dd::Events::KrakenAttack &event);
};
}
+5 -1
View File
@@ -49,6 +49,8 @@
#include "Game/ECreatePowerUp.h"
#include "Game/EPowerUpTaken.h"
#include "Game/EKrakenAppear.h"
#include "Physics/CPhysics.h"
#include "Physics/CCircleShape.h"
#include "Physics/CRectangleShape.h"
@@ -133,7 +135,7 @@ private:
bool m_Initialized = false;
bool m_Pause = false;
int m_LooseBricks = 0;
int m_CurrentCluster = 1;
int m_CurrentCluster = 0;
int m_CurrentLevel = 1;
int m_MultiBalls = 0;
int m_PowerUps = 0;
@@ -153,6 +155,8 @@ private:
const int InkBlasterBrick = 5;
const int KrakenAttackBrick = 6;
const int Kraken = 100;
EntityID m_BrickTemplate;
std::array<int, 42> m_Bricks;