2d-platformer/include/Entities/Components.h

38 lines
495 B
C++

#pragma once
//#include <tuple>
#include <SFML/Graphics.hpp>
class Component
{
public:
bool active = false;
};
class Transform : public Component
{
public:
sf::Vector2f position{};
sf::Vector2f speed{};
Transform() = default;
Transform(sf::Vector2f position_in, sf::Vector2f speed_in)
: position(position_in)
, speed(speed_in)
{ }
};
class Texture : public Component
{
public:
sf::Texture& texture;
};
class BoundingBox : public Component
{
public:
sf::FloatRect bBox{};
};