0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 15:53:42 +00:00
SDL_Minigame/include/ProjectileComponent.h

31 lines
649 B
C++

#pragma once
#include "Component.h"
#include "Vector2D.h"
#include "Constants.h"
class TransformComponent;
class ProjectileComponent : public Component
{
//can maybe be split in separate .cpp file
public:
ProjectileComponent(int range, int speed, Vector2D direction, Entity* owner)
: range(range), speed(speed), direction(direction), owner(owner) {}
~ProjectileComponent() {}
void init() override;
void update(uint_fast16_t diffTime) override;
private:
TransformComponent* transformComponent;
int range = 0;
float speed = 0;
float distance = 0;
Entity* owner = nullptr;
Vector2D direction;
};