VEGO-Engine  0.1
Loading...
Searching...
No Matches
ProjectileComponent.h
1#pragma once
2
3#include "Component.h"
4#include "Vector2D.h"
5#include "Constants.h"
6#include "SoundEffects.h"
7
9
10class ProjectileComponent : public Component
11{
12 //can maybe be split in separate .cpp file
13
14public:
15 ProjectileComponent(int range, int speed, Vector2D direction, Entity* owner, SoundEffects soundEffect)
16 : range(range), speed(speed), direction(direction), owner(owner), soundEffect(soundEffect) {}
17 ~ProjectileComponent() {}
18
19 void init() override;
20 void update(uint_fast16_t diffTime) override;
21
22private:
23 TransformComponent* transformComponent;
24
25 int range = 0;
26 float speed = 0;
27 float distance = 0;
28
29 Entity* owner = nullptr;
30
31 Vector2D direction;
32
33 SoundEffects soundEffect;
34};
The transform component is responsible for the position, direction and size of an entity....
Definition TransformComponent.h:10