Damage and Spashdamage working, phantomShapes not really working

This commit is contained in:
ViktorLjung
2014-05-27 07:04:29 +02:00
parent a0ee235473
commit c37df5c178
27 changed files with 804 additions and 202 deletions
+17
View File
@@ -0,0 +1,17 @@
#ifndef Components_FrameTimer_h__
#define Components_FrameTimer_h__
#include "Component.h"
namespace Components
{
struct FrameTimer : public Component
{
int Frames;
virtual FrameTimer* Clone() const override { return new FrameTimer(*this); }
};
}
#endif // Components_FrameTimer_h__
+2
View File
@@ -12,6 +12,8 @@
: Damage(1.0f){ }
float Damage;
float ExplosionRadius;
float ExplosionStrength;
virtual TankShell* Clone() const override { return new TankShell(*this); }
};
+17
View File
@@ -0,0 +1,17 @@
#ifndef Components_Timer_h__
#define Components_Timer_h__
#include "Component.h"
namespace Components
{
struct Timer : public Component
{
double Time;
virtual Timer* Clone() const override { return new Timer(*this); }
};
}
#endif // Components_Timer_h__
+17
View File
@@ -0,0 +1,17 @@
#ifndef Trigger_h__
#define Trigger_h__
#include "Component.h"
namespace Components
{
struct Trigger : Component
{
bool TriggerOnce;
virtual Trigger* Clone() const override { return new Trigger(*this); }
};
}
#endif // Trigger_h__
+22
View File
@@ -0,0 +1,22 @@
#ifndef TriggerExplosion_h__
#define TriggerExplosion_h__
#include "Component.h"
namespace Components
{
struct TriggerExplosion : Component
{
TriggerExplosion()
: MaxVelocity(1.f), Radius(1.f){ }
// Velocity = (1 - (distance / radius)^2) * Strength;
float MaxVelocity;
float Radius; //HACK: Radius should only be in the SphereShapeComponent
virtual TriggerExplosion* Clone() const override { return new TriggerExplosion(*this); }
};
}
#endif // TriggerExplosion_h__