VEGO-Engine
0.1
Loading...
Searching...
No Matches
ColliderComponent.h
1
#pragma once
2
3
#include <SDL.h>
4
5
#include "Component.h"
6
#include "Vector2D.h"
7
8
class
TransformComponent
;
9
10
class
ColliderComponent
:
public
Component
11
{
12
public
:
13
SDL_Rect collider;
14
const
char
* tag;
15
TransformComponent
* transform;
16
bool
hasCollision;
//added for removing collision of destroyed projectiles
17
float
hitboxScale;
//adds a seperate variable for the scale of the hitbox (not the sprite) so each sprite can have a different hitbox size if needed
18
19
bool
isProjectile =
false
;
20
21
ColliderComponent
(
const
char
* tag);
22
ColliderComponent
(
const
char
* tag,
float
hitboxScale);
23
24
void
init()
override
;
25
void
update()
override
;
26
void
removeCollision();
27
28
void
handleCollision(
Vector2D
& characterPos, SDL_Rect& characterCollider, SDL_Rect& componentCollider);
29
};
ColliderComponent
Definition
ColliderComponent.h:11
Component
Definition
Component.h:6
TransformComponent
Definition
TransformComponent.h:8
Vector2D
Definition
Vector2D.h:7
include
ColliderComponent.h
Generated by
1.11.0