-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsurprise.h
58 lines (45 loc) · 1.47 KB
/
surprise.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
#pragma once
#include "SDL2/SDL.h"
#include "defines.h"
#include "list.h"
#include "level.h"
#include "physObj.h"
#include "creature.h"
typedef enum
{
stMushroom,
stFlower,
stStar
} ESurpriseType;
typedef struct
{
ESurpriseType surpriseType;
SPhysObject* physBody;
char xDir; /* -1 âëåâî 1 âïðàâî*/
float moveSpeed; /* ñêîðîñòü äâèæåíèÿ ìàêñèìàëüíàÿ */
float accelSpeed; /* óñêîðåíèå */
/* òåêñòóðû */
SDL_Texture* texture;
} SSurprise;
/* íàáîð âñåõ ñþðïðèçîâ/áîíóñîâ */
SList* surprises;
/* èìèòàöèÿ êîíñòðóêòîðà */
SSurprise* SurpriseCreate (ESurpriseType surpriseType,
float x, float y,
ubyte w, ubyte h,
float moveSpeed,
SDL_Texture* texture);
/* èìèòàöèÿ äåñòðóêòîðà */
void SurpriseDestroy (SSurprise** surprise);
void SurpriseClearAll ();
/* îáðàáîòêà ôèçèêè è äâèæåíèÿ */
void SurpriseAddImpulse (SSurprise* surprise, float x, float y);
bool SurpriseIsCollisionPhysObject (SSurprise* s1, SPhysObject* o2);
bool SurpriseIsCollisionCreature (SSurprise* s1, SCreature* c2);
bool SurpriseIsCollisionLevelObject (SSurprise* s1, SLevelObject* l2);
/* ãåòòåðû */
void SurpriseGetSdlRect (SSurprise* surprise, SDL_Rect* rect);
SDL_Texture* SurpriseGetTexture (SSurprise* surprise);
/* AI */
void SurpriseUpdateAI (SSurprise* surprise);
void SurprisesUpdateAndRender();