-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbullet.h
66 lines (45 loc) · 1.22 KB
/
bullet.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef BULLET_H
#define BULLET_H
#include "bullet_type.h"
#include "core/math/rect2.h"
#include "core/math/transform_2d.h"
#include "core/object/object.h"
#include "core/object/ref_counted.h"
#include "scene/resources/texture.h"
class Bullet : public Object {
GDCLASS(Bullet, Object);
float time;
bool _popped;
Ref<BulletType> type;
Vector2 direction;
Vector2 position;
float rotation;
Vector2 _offset;
RID ci_rid;
void _update_offset();
void _update_appearance(const Ref<BulletType> &p_type = NULL);
protected:
static void _bind_methods();
public:
void spawn(const Ref<BulletType> &p_type, const Vector2 &p_position, const Vector2 &p_direction);
void update(float delta);
void pop();
bool is_popped();
bool can_collide();
void set_time(float p_time);
float get_time() const;
void set_type(const Ref<BulletType> &p_type);
Ref<BulletType> get_type() const;
void set_direction(const Vector2 &p_direction);
Vector2 get_direction() const;
void set_position(const Vector2 &p_position);
Vector2 get_position() const;
void set_rotation(float p_radians);
float get_rotation() const;
Transform2D get_transform();
void set_ci_rid(const RID &p_rid);
RID get_ci_rid() const;
Bullet();
~Bullet();
};
#endif