Skip to content
Snippets Groups Projects
Commit 8ce53fa7 authored by Alfred Burgess's avatar Alfred Burgess
Browse files

Added various components

parent b8cb7d3e
Branches
No related merge requests found
#ifndef __COMPONENT__COLLISION_H__
#define __COMPONENT__COLLISION_H__
#include "components/components-generic.h"
#include "maths/maths.h"
class cCollision : public CComponentGeneric
{
public:
double radius = 0.0;
cCollision(){}
cCollision( float rad )
: radius( rad ) {}
};
#endif // __COMPONENT__COLLISION_H__
\ No newline at end of file
#ifndef __COMPONENT__INPUT_H__
#define __COMPONENT__INPUT_H__
#include "components/components-generic.h"
#include "maths/maths.h"
class cInput : public CComponentGeneric
{
public:
bool up = false;
bool down = false;
bool left = false;
bool right = false;
bool shoot = false;
};
#endif // __COMPONENT__INPUT_H__
#ifndef __COMPONENT__POINT_BAR_H__
#define __COMPONENT__POINT_BAR_H__
#include "components/components-generic.h"
#include "maths/maths.h"
class cPointBar : public CComponentGeneric
{
public:
cPointBar( uint16_t value )
: _total(value), _current(value) {}
private:
uint16_t _total;
uint16_t _current;
};
#endif // __COMPONENT__POINT_BAR_H__
#ifndef __COMPONENT__SHAPE_H__
#define __COMPONENT__SHAPE_H__
#include "components/components-generic.h"
#include "maths/maths.h"
class cShape : public CComponentGeneric
{
public:
cShape( uint8_t verticies )
: _verticies( verticies ) {}
private:
uint8_t _verticies;
};
#endif // __COMPONENT__SHAPE_H__
...@@ -7,10 +7,14 @@ ...@@ -7,10 +7,14 @@
class cTransform : public CComponentGeneric class cTransform : public CComponentGeneric
{ {
public: public:
Vec2 position; Vec2 position = { 0.0, 0.0 };
Vec2 velocity; Vec2 velocity = { 0.0, 0.0 };
Vec2 scale; Vec2 scale = { 0.0, 0.0 };
double angle; double angle = 0.0;
cTransform(){}
cTransform( const Vec2 &pos, const Vec2 &vel, float ang )
: position(pos), velocity(vel), angle(ang) {}
}; };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment