MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / GameObject

Class GameObject

LuaSTGPlus/GameObjectPool.h:19–111  ·  view source on GitHub ↗

@brief ��Ϸ����

Source from the content-addressed store, hash-verified

17
18 /// @brief ��Ϸ����
19 struct GameObject
20 {
21 GAMEOBJECTSTATUS status; // (���ɼ�)����״̬
22 size_t id; // (���ɼ�)�����ڶ�����е�id
23 int64_t uid; // (���ɼ�)����Ψһid
24
25 lua_Number x, y; // ��������
26 lua_Number lastx, lasty; // (���ɼ�)��һ֡��������
27 lua_Number dx, dy; // (ֻ��)��һ֡��������������������ƫ����
28 lua_Number rot, omiga; // ��ת�Ƕ���Ƕ�����
29 lua_Number vx, vy; // �ٶ�
30 lua_Number ax, ay; // ���ٶ�
31 lua_Number layer; // ͼ��
32 lua_Number a, b; // ��λ�ĺ���������ײ��С��һ��
33 lua_Number hscale, vscale; // �������������ʣ���Ӱ����Ⱦ
34
35 bool colli; // �Ƿ������ײ
36 bool rect; // �Ƿ�Ϊ������ײ��
37 bool bound; // �Ƿ�Խ�����
38 bool hide; // �Ƿ�����
39 bool navi; // �Ƿ��Զ�ת��
40
41 // ��colli,a,b,rect����Ӱ�����ײ����Բ�뾶
42 lua_Number col_r;
43
44 lua_Integer group; // �������ڵ���ײ��
45 lua_Integer timer, ani_timer; // ������
46
47 Resource* res; // ��Ⱦ��Դ
48 ResParticle::ParticlePool* ps; // ����ϵͳ
49
50 // ������
51 GameObject *pObjectPrev, *pObjectNext;
52 GameObject *pRenderPrev, *pRenderNext;
53 GameObject *pCollisionPrev, *pCollisionNext;
54
55 void Reset()
56 {
57 status = STATUS_FREE;
58 id = (size_t)-1;
59 uid = 0;
60
61 x = y = 0.;
62 lastx = lasty = 0.;
63 dx = dy = 0.;
64 rot = omiga = 0.;
65 vx = vy = 0.;
66 ax = ay = 0.;
67 layer = 0.;
68 a = b = 0.;
69 hscale = vscale = 1.;
70
71 colli = bound = true;
72 rect = hide = navi = false;
73
74 col_r = 0.;
75
76 group = LGOBJ_DEFAULTGROUP;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected