-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathracket.hpp
41 lines (31 loc) · 1.04 KB
/
racket.hpp
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 RACKET_HPP
#define RACKET_HPP
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
class Racket
{
private:
ISceneNode* m_node;
double m_speed;
vector2df m_size;
vector2df m_position;
vector2df m_velocity;
vector2df m_target;
u32 m_life;
void step(u32 dt);
public:
Racket(vector2df size = vector2df(2,1),
vector2df pos = vector2df(0, 0),
int life = 3);
void setPosition(const vector2df& pos) { m_position = pos; }
void fail() { m_life -= 1; }
const vector2df& getSize() const { return m_size; }
const vector2df& getPosition() const { return m_position; }
const vector2df& getVelocity() const { return m_velocity; }
const int getLife() { return m_life; }
void setTarget(const vector2df& target);
void animate(u32 dt);
};
#endif