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
10class TransformComponent : public Component
11{
12public:
13 Vector2D position; // TODO: change to int to save CPU time -> possibly subpixel coordinates
14 Vector2D direction;
15
16 int height = 32;
17 int width = 32;
18 int scale = 1;
19
21 explicit TransformComponent(int scale = 1);
22 TransformComponent(float x, float y, int scale = 1);
23 TransformComponent(float x, float y, int w, int h, int scale = 1);
24
25 void init() override;
26 void update(uint_fast16_t diffTime) override;
27 void setPositionAfterCollision(Vector2D& positionChange);
28 int getSpeed();
29
30};
TransformComponent(int scale=1)
Definition TransformComponent.cpp:16