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
7
class
TransformComponent
;
8
9
class
ProjectileComponent
:
public
Component
10
{
11
//can maybe be split in separate .cpp file
12
13
public
:
14
ProjectileComponent
(
int
range,
int
speed,
Vector2D
direction,
Entity
* owner)
15
: range(range), speed(speed), direction(direction), owner(owner) {}
16
~ProjectileComponent
() {}
17
18
void
init()
override
;
19
void
update()
override
;
20
21
private
:
22
TransformComponent
* transformComponent;
23
24
int
range = 0;
25
int
speed = 0;
26
int
distance = 0;
27
28
Entity
* owner =
nullptr
;
29
30
Vector2D
direction;
31
};
Component
Definition
Component.h:6
Entity
Main class for any object in game, stores associations, labeling and components.
Definition
Entity.h:35
ProjectileComponent
Definition
ProjectileComponent.h:10
TransformComponent
Definition
TransformComponent.h:8
Vector2D
Definition
Vector2D.h:7
include
ProjectileComponent.h
Generated by
1.12.0