mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 23:33:41 +00:00
31 lines
649 B
C++
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;
|
|
}; |