Jagguar Game Engine

Loading...
Searching...
No Matches
ProjectileComponent.hpp
1#ifndef PROJECTILECOMPONENT_HPP
2#define PROJECTILECOMPONENT_HPP
3
4#include "TinyMath.hpp"
5#include "RigidbodyComponent.hpp"
6#include <string>
7
11 class ProjectileComponent : public Component
12{
13 public:
22 ProjectileComponent(RigidbodyComponent *_projectile, TransformComponent *_target, bool _homing, float _var);
23
27 ~ProjectileComponent();
28
29 void Update(SDL_Event e, int frame, std::vector<std::string> broadcastList) override;
30
31 void Render(SDL_Renderer *ren) override;
32
33 private:
34 RigidbodyComponent *projectile;
35 TransformComponent *target;
36 bool homing;
37 float speed;
38 float angle;
39
40 float gravity = 10;
41};
42
43#endif
Component
Definition: Component.hpp:38
ProjectileComponent
Definition: ProjectileComponent.hpp:12
ProjectileComponent::Update
void Update(SDL_Event e, int frame, std::vector< std::string > broadcastList) override
Definition: ProjectileComponent.cpp:40
ProjectileComponent::Render
void Render(SDL_Renderer *ren) override
Definition: ProjectileComponent.cpp:54
ProjectileComponent::~ProjectileComponent
~ProjectileComponent()
Definition: ProjectileComponent.cpp:36
ProjectileComponent::homing
bool homing
Definition: ProjectileComponent.hpp:36
RigidbodyComponent
Definition: RigidbodyComponent.hpp:13
TransformComponent
Definition: TransformComponent.hpp:12