-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCRectObject.h
41 lines (31 loc) · 909 Bytes
/
CRectObject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef PLATFORM_H
#define PLATFORM_H
#include "Collider.h"
#include "Obstacle.h"
class CRectObject : public Obstacle {
public:
CRectObject() {}
CRectObject(sf::Vector2f a_oSize, sf::Vector2f a_oPosition, bool a_bOutline = false);
~CRectObject(){}
void Draw(sf::RenderWindow &a_oWindow);
void SetFillColor(sf::Color &a_oColor);
void ResetFillColor();
void SetPosition(sf::Vector2f &a_oPosition);
void SetXSpeed(float a_dSpeed);
void UpdateMovement(float a_dDeltaTime);
void Fade();
Collider GetCollider() { return Collider(m_oBody, m_bIsPlatform); }
float GetLeft();
float GetRight();
Shape GetShape() { return Rectangle; }
private:
sf::RectangleShape m_oBody;
float m_dXSpeed = 0;
// For fading away.
float m_dDefaultColor = 0;
float m_dStartingColor = 0;
sf::Clock m_oFadeTimer;
bool m_bIsFading = false;
bool m_bIsPlatform;
};
#endif