all repos — hyperkaos @ 1d7fe3d8c9679faf818524248c9d7ccfbc6791ce

lightweight modular puzzle/adventure game engine in C with SDL 1.2

Room.h (raw)

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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
typedef struct hyperKaos HyperKaos;
typedef struct synergy Synergy;

typedef struct obstruction
{
  SDL_Rect domain;
  int tombStone;
} Obstruction;

Obstruction* newObstruction(int x, int y, int w, int h);
void deleteObstruction(Obstruction* target);

typedef struct fgImage
{
  int frames;
  int frameNow;
  int dualLayer;
  int tombStone;

  SDL_Rect location;
  SDL_Surface* spriteSheet;
} FGImage;

FGImage* newFGImage(int x, int y, int w, int h, int f, int dual, char* filename, int alpha);
void deleteFGImage(FGImage* target);

typedef struct warpZone
{
  SDL_Rect location;
  enum dataChunks chunk;
  int destination;
  int x, y;
  int tombStone;
} WarpZone;

WarpZone* newWarpZone(int x, int y, int w, int h, enum dataChunks chunk, int dest, int dX, int dY);
void deleteWarpZone(WarpZone* target);

typedef struct room
{
  SDL_Surface* spriteSheet;
  SDL_Rect clip;
  int frameNo;

  Obstruction** obstacle;
  int numberOfObstacles;
  int maxNumberOfObstacles;

  FGImage** fgObject;
  int numberOfObj;
  int maxNumberOfObj;
  int objSpeed;
  int objIterator;

  WarpZone** warps;
  int numberOfWarps;
  int maxNumberOfWarps;

  HyperKaos** eventTriggers;
  int numberOfTriggers;
  int maxNumberOfTriggers;

  Synergy** sigils;
  int numberOfSigils;
  int maxNumberOfSigils;

  Player** people;
  int numberOfPeople;
  int maxNumberOfPeople;

} Room;

void warpto(Room* destination);

Room* newRoom(char* filename, int a);
void deleteRoom(Room* target);

void animate(Room* self);

int checkCollision(Room* self, Player* player, Obstruction** box);
int checkWCollision(Room* self, Player* player, WarpZone** warpBoxes, int* whichWarp);
int checkKCollision(Room* self, Player* player, HyperKaos** triggers, int* whichTrigger, int* triggerType, int iType);

void addObstacle(Room* self, int x, int y, int w, int h);
void deleteObstacle(Room* self, int i);

void addFgObj(Room* self, int x, int y, int w, int h, char* filename, int f, int dual, int alpha);
void deleteFgObj(Room* self, int i);
void drawFgObjects1(Room* self);
void drawFgObjects2(Room* self);

void addWarp(Room* self, int x, int y, int w, int h, enum dataChunks toChunk, int toRoom, int toX, int toY);
void deleteWarp(Room* self, int i);

void addTrigger(Room* self, HyperKaos* newTrigger);
void deleteTrigger(Room* self, int i);

void addSigil(Room* self, Synergy* newSigil);
void deleteSigil(Room* self, int i);

void addPerson(Room* self, Player* newPlayer);
void deletePerson(Room* self, int i);
void drawPeople(Room* self);