VEGO-Engine  0.1
Loading...
Searching...
No Matches
TransformComponent.h
1#pragma once
2
3#include "Component.h"
4#include "Vector2D.h"
5#include "Constants.h"
6#include "DataComponent.h"
7
9class TransformComponent : public Component
10{
11public:
12 Vector2D position; // TODO: change to int to save CPU time -> possibly subpixel coordinates
13 Vector2D direction;
14
15 int height = 32;
16 int width = 32;
17 float scale = 1;
18
20
22 explicit TransformComponent(float scale = 1);
23
27 TransformComponent(float x, float y, float scale = 1);
28
34 TransformComponent(float x, float y, int w, int h, float scale = 1);
35
36 void init() override;
37 void update(uint_fast16_t diffTime) override;
38 void setPositionAfterCollision(Vector2D& positionChange);
39 int getSpeed();
40
41};
TransformComponent(float scale=1)
Definition TransformComponent.cpp:16