This commit is contained in:
PlatinumSkink
2015-10-08 21:52:21 +02:00
23 changed files with 3831 additions and 36 deletions
+1
View File
@@ -201,6 +201,7 @@ public:
}
//Background
{
auto background = m_World->CreateEntity();
auto transform = m_World->AddComponent<Components::Transform>(background);
+2
View File
@@ -43,6 +43,8 @@
#include <fstream>
#include <iostream>
#include "Physics/ECreateParticleSequence.h"
namespace dd
{
+3 -2
View File
@@ -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;
};
}
+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;
};