-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActor.h
More file actions
46 lines (36 loc) · 940 Bytes
/
Actor.h
File metadata and controls
46 lines (36 loc) · 940 Bytes
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
42
43
44
45
46
#ifndef DEF_ACTOR
#define DEF_ACTOR
#include <iostream>
#include <vector>
#include <SFML/Graphics.hpp>
#include "GameObject.h"
#include "SceneComponent.h"
using namespace std;
class Actor : public GameObject
{
public:
using GameObject::GameObject;
Actor();
~Actor();
Actor(sf::Vector2f);
void setLocation(sf::Vector2f);
void move(sf::Vector2f);
sf::Vector2f getLocation();
vector<sf::Sprite *> getSprites();
virtual std::vector<sf::Sprite *> getDraw();
bool addChild(SceneComponent*);
void setSimulatePhysics(bool);
void updatePhysicsTick(float);
virtual void updateComponent();
private:
std::vector<SceneComponent> m_childs;
bool m_simulatePhysics;
std::vector<sf::Vector2f> m_totalExtForces;
float m_mass;
float creationTime = 0;
sf::Vector2f m_location;
sf::Clock m_clock;
sf::Time m_physicLastTime;
sf::Vector2f m_velocity;
};
#endif