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