VEGO-Engine
0.1
Loading...
Searching...
No Matches
ColliderComponent.h
1
#pragma once
2
3
#include <SDL3/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(uint_fast16_t diffTime)
override
;
26
void
removeCollision();
27
28
void
handleCollision(
Vector2D
& characterPos, SDL_Rect& characterCollider, SDL_Rect& componentCollider);
29
};
Component
Definition
Component.h:8
TransformComponent
Definition
TransformComponent.h:9
Vector2D
Definition
Vector2D.h:7
include
ColliderComponent.h
Generated by
1.13.2