Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. #ifndef OBJECT_H
  2. #define OBJECT_H
  3.  
  4. #include "collision.h"
  5.  
  6. typedef struct {
  7.         void* data; //Specific object struct
  8.         void (*objectStep)();
  9.         void (*objectDraw)();
  10.         int type;
  11. } Object;
  12.  
  13. void objectDestroy(int id);
  14.  
  15. //Health/Ammo collectables
  16. typedef struct {
  17.         int id, type; //0 for ammo, 1 for heart
  18.         double x, y,
  19.                    vsp, grav;
  20.                    
  21.         int blink, canLand, bounce;
  22. } Ammo;
  23.  
  24. void spawnCollectable(int x, int y);
  25. void createAmmo(int x, int y, int type);
  26.  
  27. //Destroyable blocks
  28. typedef struct {
  29.         int id;
  30.         int x, y;
  31.         int hp/*, invulnerable*/;
  32.         int secret;
  33.         Mask mask;
  34. } Destroyable;
  35.  
  36. void createDestroyable(int x, int y, int secret);
  37.  
  38. //Secret Trigger
  39. typedef struct {
  40.         int id, flag;
  41.         int type, enemyType;
  42. } SecretTrigger;
  43.  
  44. void createSecretTrigger(int type, int enemyType, int flag);
  45.  
  46. //Chest
  47. typedef struct {
  48.         int id;
  49.         int x, y;
  50.         int item, secret;
  51.         int visible;
  52.         int timer;
  53.        
  54.         Mask mask;
  55. } Chest;
  56.  
  57. void createChest(int x, int y, int item, int secret);
  58.  
  59. //Save point
  60. typedef struct {
  61.         int id;
  62.         int x, y;
  63.         double imageIndex;
  64.        
  65.         Mask mask;
  66. } SavePoint;
  67.  
  68. void createSavePoint(int x, int y, int hidden);
  69.  
  70. //Door
  71. typedef struct {
  72.         int id;
  73.         int x, y;
  74.         int open, secret, visible;
  75.        
  76.         int warplevel, warpcoords;
  77.         int warpx, warpy;
  78.        
  79.         Mask mask;
  80. } Door;
  81.  
  82. void createDoor(int x, int y, int level, int coords, int warpx, int warpy, int secret);
  83.  
  84. //Lock Block
  85. typedef struct {
  86.         int id, flag;
  87.         int x, y;
  88.         int tile;
  89.         int invincible;
  90. } LockBlock;
  91.  
  92. void createLockBlock(int x, int y, int flag);
  93.  
  94. //Light Switch
  95. typedef struct {
  96.         int id, flag;
  97.         int x, y;
  98.         int activated;
  99.         double imageIndex;
  100. } Switch;
  101.  
  102. void createSwitch(int x, int y, int flag);
  103.  
  104. //Blue/Red Gates
  105. typedef struct {
  106.         int id;
  107.         int x, y;
  108.         int col;
  109.         int timer, open;
  110.         //int invincible;
  111.         double imageIndex;     
  112. } Gate;
  113.  
  114. void createGate(int x, int y, int col);
  115.  
  116. //Statue
  117. typedef struct {
  118.         int id;
  119.         int x, y;
  120.         int type;
  121.         int invincible;
  122.         int hp;
  123. } Statue;
  124.  
  125. void createStatue(int x, int y, int type);
  126.  
  127. //Button
  128. typedef struct {
  129.         int id;
  130.         int x, y;
  131.         int flag;
  132.         int pressed;
  133. } FloorPad;
  134.  
  135. void createFloorPad(int x, int y, int flag);
  136.  
  137. //Ladder
  138. typedef struct {
  139.         int id;
  140.         int x, y;
  141.         int flag;
  142. } Ladder;
  143.  
  144. void createLadder(int x, int y, int flag);
  145.  
  146. //Generator
  147. typedef struct {
  148.         int id;
  149.         int hp;
  150.         int blink;
  151.         int x, y;
  152.         double imageIndex;
  153.         int flag;
  154. } Generator;
  155.  
  156. void createGenerator(int x, int y, int flag);
  157.  
  158. //Electric gate
  159. typedef struct {
  160.         int id;
  161.         int x, y;
  162.         double imageIndex;
  163.         int flag;
  164. } Shockgate;
  165.  
  166. void createShockgate(int x, int y, int flag);
  167.  
  168. //Ending crown
  169. typedef struct {
  170.         int id;
  171.         int x, ystart;
  172.         double y;
  173.         double bobRot;
  174.         double imageIndex;
  175.         int timer;
  176.         char visible;
  177. } Crown;
  178.  
  179. void createCrown(int x, int y);
  180.  
  181. #endif