Merge remote-tracking branch 'origin/master' into water
Conflicts: src/game/Game/LevelSystem.cpp
This commit is contained in:
@@ -44,10 +44,12 @@
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CPad.h"
|
||||
#include "Game/CLifebuoy.h"
|
||||
#include "Game/CProjectile.h"
|
||||
#include "Game/CBrick.h"
|
||||
#include "Game/BallSystem.h"
|
||||
#include "Game/HitLagSystem.h"
|
||||
#include "Game/LifebuoySystem.h"
|
||||
#include "Game/ProjectileSystem.h"
|
||||
#include "Game/Bricks/CPowerUpBrick.h"
|
||||
|
||||
#include "Physics/PhysicsSystem.h"
|
||||
@@ -113,6 +115,7 @@ public:
|
||||
m_World->ComponentFactory.Register<Components::Pad>();
|
||||
m_World->ComponentFactory.Register<Components::Life>();
|
||||
m_World->ComponentFactory.Register<Components::Lifebuoy>();
|
||||
m_World->ComponentFactory.Register<Components::Projectile>();
|
||||
|
||||
m_World->ComponentFactory.Register<Components::PowerUp>();
|
||||
m_World->ComponentFactory.Register<Components::PowerUpBrick>();
|
||||
@@ -132,6 +135,9 @@ public:
|
||||
m_World->SystemFactory.Register<Systems::LifebuoySystem>(
|
||||
[this]() { return new Systems::LifebuoySystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::LifebuoySystem>();
|
||||
m_World->SystemFactory.Register<Systems::ProjectileSystem>(
|
||||
[this]() { return new Systems::ProjectileSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::ProjectileSystem>();
|
||||
m_World->SystemFactory.Register<Systems::PhysicsSystem>(
|
||||
[this]() { return new Systems::PhysicsSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::PhysicsSystem>();
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "Game/EMultiBall.h"
|
||||
#include "Game/EMultiBallLost.h"
|
||||
#include "Game/EStickyPad.h"
|
||||
#include "Game/EInkBlaster.h"
|
||||
#include "Game/EGameOver.h"
|
||||
#include "Game/EPause.h"
|
||||
#include "Game/EHitPad.h"
|
||||
@@ -94,8 +95,8 @@ private:
|
||||
bool m_Pause = false;
|
||||
bool m_Waiting = true;
|
||||
bool m_Sticky = false;
|
||||
bool m_InkBlaster = false;
|
||||
int m_StickyCounter = 5;
|
||||
EntityID m_LastCollision = 999999;
|
||||
|
||||
glm::vec3 m_SavedSpeed;
|
||||
bool m_InitializePause = false;
|
||||
@@ -110,6 +111,7 @@ private:
|
||||
dd::EventRelay<BallSystem, dd::Events::ResetBall> m_EResetBall;
|
||||
dd::EventRelay<BallSystem, dd::Events::MultiBall> m_EMultiBall;
|
||||
dd::EventRelay<BallSystem, dd::Events::StickyPad> m_EStickyPad;
|
||||
dd::EventRelay<BallSystem, dd::Events::InkBlaster> m_EInkBlaster;
|
||||
dd::EventRelay<BallSystem, dd::Events::Pause> m_EPause;
|
||||
dd::EventRelay<BallSystem, dd::Events::Contact> m_Contact;
|
||||
dd::EventRelay<BallSystem, dd::Events::ActionButton> m_EActionButton;
|
||||
@@ -120,6 +122,7 @@ private:
|
||||
bool OnResetBall(const dd::Events::ResetBall &event);
|
||||
bool OnMultiBall(const dd::Events::MultiBall &event);
|
||||
bool OnStickyPad(const dd::Events::StickyPad &event);
|
||||
bool OnInkBlaster(const dd::Events::InkBlaster &event);
|
||||
bool OnPause(const dd::Events::Pause &event);
|
||||
bool OnActionButton(const dd::Events::ActionButton &event);
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@ struct Ball : Component
|
||||
int Combo = 0;
|
||||
bool Paused = false;
|
||||
bool Waiting = true;
|
||||
bool InkBlaster = false;
|
||||
bool Sticky = false;
|
||||
glm::vec3 StickyPlacement = glm::vec3(0, 0, 0);
|
||||
glm::vec3 SavedSpeed = glm::vec3(0, 0, 0);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-10-08.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_CPROJECTILE_H
|
||||
#define DAYDREAM_CPROJECTILE_H
|
||||
|
||||
#include "Core/Component.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Components
|
||||
{
|
||||
|
||||
struct Projectile : Component
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_CPROJECTILE_H
|
||||
@@ -15,7 +15,7 @@ namespace Events
|
||||
|
||||
struct ActionButton : Event
|
||||
{
|
||||
|
||||
glm::vec3 Position;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define DAYDREAM_EHITPAD_H
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/Entity.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -13,7 +14,8 @@ namespace Events
|
||||
{
|
||||
struct HitPad : Event
|
||||
{
|
||||
|
||||
EntityID Pad;
|
||||
EntityID Ball;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-10-08.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_EINKBLASTER_H
|
||||
#define DAYDREAM_EINKBLASTER_H
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct InkBlaster : Event
|
||||
{
|
||||
Components::Transform* Transform;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_EINKBLASTER_H
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-17.
|
||||
// Created by Adniklastrator on 2015-10-08.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_ELIFEBUOY_H
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "Game/CBrick.h"
|
||||
#include "Game/CBall.h"
|
||||
#include "Game/CLife.h"
|
||||
#include "Game/CProjectile.h"
|
||||
#include "Game/CPowerUp.h"
|
||||
#include "Game/EStageCleared.h"
|
||||
#include "Game/ELifeLost.h"
|
||||
@@ -24,6 +25,7 @@
|
||||
#include "Game/EHitPad.h"
|
||||
#include "Game/ELifebuoy.h"
|
||||
#include "Game/EStickyPad.h"
|
||||
#include "Game/EInkBlaster.h"
|
||||
#include "Game/EMultiBall.h"
|
||||
#include "Game/EMultiBallLost.h"
|
||||
#include "Game/EPause.h"
|
||||
@@ -129,6 +131,7 @@ private:
|
||||
const int MultiBallBrick = 2;
|
||||
const int LifebuoyBrick = 3;
|
||||
const int StickyBrick = 4;
|
||||
const int InkBlasterBrick = 5;
|
||||
|
||||
EntityID m_BrickTemplate;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
bool OnPause(const dd::Events::Pause &event);
|
||||
bool OnLifebuoy(const dd::Events::Lifebuoy &event);
|
||||
|
||||
struct LifeBuoyInfo
|
||||
struct LifebuoyInfo
|
||||
{
|
||||
EntityID Entity;
|
||||
float TimeToLive = 15.f;
|
||||
@@ -61,7 +61,8 @@ private:
|
||||
|
||||
float m_LeftEdge = -3.8f;
|
||||
float m_RightEdge = 3.8f;
|
||||
std::list<LifeBuoyInfo> m_LifeBuoys;
|
||||
float m_DownEdge = -9.2f;
|
||||
std::list<LifebuoyInfo> m_Lifebuoys;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// Created by Adniklastrator on 2015-09-09.
|
||||
//
|
||||
|
||||
#ifndef DAYDREAM_PROJECTILESYSTEM_H
|
||||
#define DAYDREAM_PROJECTILESYSTEM_H
|
||||
|
||||
#include "Core/System.h"
|
||||
#include "Core/CTransform.h"
|
||||
#include "Core/CTemplate.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include "Core/World.h"
|
||||
#include "Physics/EContact.h"
|
||||
#include "Rendering/CModel.h"
|
||||
#include "Physics/CPhysics.h"
|
||||
#include "Physics/CCircleShape.h"
|
||||
#include "Game/EPause.h"
|
||||
#include "Game/EInkBlaster.h"
|
||||
#include "Game/EActionButton.h"
|
||||
#include "Game/EHitPad.h"
|
||||
#include "Game/CProjectile.h"
|
||||
#include "Game/CBall.h"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
namespace Systems
|
||||
{
|
||||
|
||||
class ProjectileSystem : public System
|
||||
{
|
||||
public:
|
||||
ProjectileSystem(World* world, std::shared_ptr<dd::EventBroker> eventBroker)
|
||||
: System(world, eventBroker)
|
||||
{ }
|
||||
|
||||
void Initialize() override;
|
||||
|
||||
void Update(double dt) override;
|
||||
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||
|
||||
bool IsPaused() const { return m_Pause; }
|
||||
void SetPause(const bool& pause) { m_Pause = pause; }
|
||||
|
||||
private:
|
||||
bool m_Pause = false;
|
||||
bool m_InkBlaster = false;
|
||||
bool m_SquidLoaded = false;
|
||||
int m_Shots = 0;
|
||||
EntityID m_InkBlastTemplate;
|
||||
EntityID m_AttachedSquid;
|
||||
|
||||
dd::EventRelay<ProjectileSystem, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<ProjectileSystem, dd::Events::Pause> m_EPause;
|
||||
dd::EventRelay<ProjectileSystem, dd::Events::InkBlaster> m_EInkBlaster;
|
||||
dd::EventRelay<ProjectileSystem, dd::Events::HitPad> m_EHitPad;
|
||||
dd::EventRelay<ProjectileSystem, dd::Events::ActionButton> m_EActionButton;
|
||||
|
||||
bool OnContact(const dd::Events::Contact &event);
|
||||
bool OnPause(const dd::Events::Pause &event);
|
||||
bool OnInkBlaster(const dd::Events::InkBlaster &event);
|
||||
bool OnHitPad(const dd::Events::HitPad &event);
|
||||
bool OnActionButton(const dd::Events::ActionButton &event);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //DAYDREAM_PROJECTILESYSTEM_H
|
||||
@@ -16,7 +16,8 @@ enum Type
|
||||
PowerUp = 1 << 4,
|
||||
Other = 1 << 5,
|
||||
Wall = 1 << 6,
|
||||
LifeBuoy = 1 << 7
|
||||
LifeBuoy = 1 << 7,
|
||||
Projectile = 1 << 8
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user