0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 15:53:42 +00:00
SDL_Minigame/include/ProjectileComponent.h
freezarite 9bb9d0fbcc removed maps regarding music and sound effects from the AssetManager
reworked SoundManager to use enum classes as keys in its maps and to no longer use the AssetManager
added possibility to set sound effect of projectiles when creating them (was hard coded)
2025-01-28 19:08:05 +01:00

34 lines
758 B
C++

#pragma once
#include "Component.h"
#include "Vector2D.h"
#include "Constants.h"
#include "SoundEffects.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, SoundEffects soundEffect)
: range(range), speed(speed), direction(direction), owner(owner), soundEffect(soundEffect) {}
~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;
SoundEffects soundEffect;
};