Merge remote-tracking branch 'origin/master' into Physics

This commit is contained in:
viktorljung
2015-10-08 23:19:23 +02:00
20 changed files with 322 additions and 53 deletions
+1
View File
@@ -201,6 +201,7 @@ public:
}
//Background
{
auto background = m_World->CreateEntity();
auto transform = m_World->AddComponent<Components::Transform>(background);
+5
View File
@@ -23,6 +23,7 @@
#include "Game/EMultiBallLost.h"
#include "Game/EStickyPad.h"
#include "Game/EInkBlaster.h"
#include "Game/EInkBlasterOver.h"
#include "Game/EGameOver.h"
#include "Game/EPause.h"
#include "Game/EHitPad.h"
@@ -97,6 +98,8 @@ private:
bool m_Waiting = true;
bool m_Sticky = false;
bool m_InkBlaster = false;
bool m_InkAttached = false;
bool m_BlockedWaiting = false;
int m_StickyCounter = 5;
glm::vec3 m_SavedSpeed;
@@ -113,6 +116,7 @@ private:
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::InkBlasterOver> m_EInkBlasterOver;
dd::EventRelay<BallSystem, dd::Events::Pause> m_EPause;
dd::EventRelay<BallSystem, dd::Events::Contact> m_Contact;
dd::EventRelay<BallSystem, dd::Events::ActionButton> m_EActionButton;
@@ -124,6 +128,7 @@ private:
bool OnMultiBall(const dd::Events::MultiBall &event);
bool OnStickyPad(const dd::Events::StickyPad &event);
bool OnInkBlaster(const dd::Events::InkBlaster &event);
bool OnInkBlasterOver(const dd::Events::InkBlasterOver &event);
bool OnPause(const dd::Events::Pause &event);
bool OnActionButton(const dd::Events::ActionButton &event);
};
+25
View File
@@ -0,0 +1,25 @@
//
// Created by Adniklastrator on 2015-10-08.
//
#ifndef DAYDREAM_EINKBLASTEROVER_H
#define DAYDREAM_EINKBLASTEROVER_H
#include "Core/EventBroker.h"
namespace dd
{
namespace Events
{
struct InkBlasterOver : Event
{
EntityID Ball;
};
}
}
#endif //DAYDREAM_EINKBLASTEROVER_H
+4 -1
View File
@@ -44,6 +44,8 @@
#include <fstream>
#include <iostream>
#include "Physics/ECreateParticleSequence.h"
namespace dd
{
@@ -72,7 +74,7 @@ public:
void CreateBasicLevel(int, int, glm::vec2, float);
void CreateLevel(int);
void CreateBrick(int, int, glm::vec2, float, int, int, int);
void CreateBrick(int, int, glm::vec2, float, int, int, int, glm::vec4);
void OnEntityRemoved(EntityID entity);
@@ -135,6 +137,7 @@ private:
EntityID m_BrickTemplate;
std::array<int, 42> m_Bricks;
std::array<glm::vec4, 42> m_Colors;
dd::EventRelay<LevelSystem, dd::Events::Contact> m_EContact;
dd::EventRelay<LevelSystem, dd::Events::ScoreEvent> m_EScoreEvent;
+2
View File
@@ -10,12 +10,14 @@
#include "Core/CTemplate.h"
#include "Core/EventBroker.h"
#include "Core/World.h"
#include "Core/EventBroker.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/EInkBlasterOver.h"
#include "Game/EActionButton.h"
#include "Game/EHitPad.h"
#include "Game/CProjectile.h"
+3 -1
View File
@@ -9,11 +9,13 @@ namespace Components
struct ParticleEmitter : public Component
{
EntityID Parent = 0;
int NumberOfTicks = 10.f;
float InitialSpeed = 1.f;
double SpawnRate = 1;
int ParticlesPerTick = 1;
double TimeSinceLastSpawn = 0;
//TODO: Refactor. Have cooldown instead of this
double TimeSinceLastSpawn = 100;
int MaxCount = 0;
float EmittingAngle = 0.f;
float Spread = 0.f;
+1
View File
@@ -19,6 +19,7 @@ struct Contact : Event
{
EntityID Entity1;
EntityID Entity2;
glm::vec2 IntersectionPoint;
glm::vec2 Normal;
glm::vec2 SignificantNormal;
};
+3 -1
View File
@@ -22,9 +22,11 @@ struct CreateParticleSequence : public Event
float Spread = 1.f;
float EmittingAngle = 0.f;
float MaxCount = 0;
glm::vec4 Color = glm::vec4(0);
EntityID parent = 0;
//Particle
std::string SpriteFile = "Texures/Core/ErrorTexture.png";
std::string SpriteFile = "";
double ParticleLifeTime = 3.f;
ParticleFlags::Type Flags = static_cast<ParticleFlags::Type>(ParticleFlags::Powder | ParticleFlags::ParticleContactFilter | ParticleFlags::FixtureContactFilter);
float Radius = 1.f;
+5 -2
View File
@@ -37,6 +37,7 @@
#include "Game/CBall.h"
#include "Rendering/CSprite.h"
#include "Rendering/CModel.h"
namespace dd
@@ -113,6 +114,8 @@ namespace dd
bool OnPause(const dd::Events::Pause &event);
dd::EventRelay<PhysicsSystem, dd::Events::StageCleared> m_EStageCleared;
bool OnStageCleared(const dd::Events::StageCleared &event);
dd::EventRelay<PhysicsSystem, dd::Events::Contact> m_EContact;
bool OnContact(const dd::Events::Contact &event);
bool m_Travelling = false;
float m_DistanceTravelled = 0;
@@ -173,7 +176,7 @@ namespace dd
{
return false;
}
};
@@ -196,7 +199,7 @@ namespace dd
};
DestructionListener* m_DestructionListener;
ParticleContactDisabler m_ParticleContactDisabler;
ParticleContactDisabler* m_ParticleContactDisabler;
ContactListener* m_ContactListener;
};