view spe/task_object.h @ 49:f4140672ef9f

fix.
author koba <koba@cr.ie.u-ryukyu.ac.jp>
date Fri, 21 Jan 2011 22:18:28 +0900
parents
children 2e123c4bf5ca
line wrap: on
line source

#ifndef INCLUDE_OBJECT
#define INCLUDE_OBJECT

#define TAMALV1P 14
#define TAMALV2P 50
#define TAMALV3P 24

#define LASERLV1P 17
#define LASERLV2P 154
#define LASERLV3P 51

#define TRUE 1
#define FALSE 0
#define BOOL char

typedef struct player {
    int x;
    int y;
    int ch;
    int point;
    BOOL bf;
    int muteki;
    int zanki;
    int ccount;
} player;


typedef struct tama {
    int x;
    int y;
} tama;


typedef struct tama1 {
    int x;
    int y;
    int r;
    int l;
} tama1;


typedef struct tama2 {
    int x;
    int y;
    int rr;
    int sr;
    int sl;
    int ll;
} tama2;


typedef struct stge {
    int stg;
} stge;


typedef struct laser {
    float x;
    float y;
    float sx;
    float sy;
    int r;
    int enemyno;
  float s;
} laser;


typedef struct bomchar {
    int x;
    int y;
    int f;
    int no;
} bomchar;


typedef struct CHARACTER{
  float x; //position
  float y;
 
  float vx; //velocity
  float vy;

  float vit; //vitality
  int score;
  int dt1;
  int dt2;
  int charano; //sprite_number
  BOOL tama; //bullet identifier
  BOOL f; //apiarance idenfifier
  float s;
  int task;

  struct CHARACTER * (*state)(struct CHARACTER *p);
  struct CHARACTER * (*collision)(struct CHARACTER *p);
  struct CHARACTER *next;
  struct CHARACTER *prev;

} CHARACTER;


typedef struct CollisionProperty {
  int infg_level;
  int enemycount;

  player jiki;
  stge lg;
  stge infg;

  tama1 tama_lv1[20];
  tama2 tama_lv2[20];
  tama1 tlv3;
  laser laser_lv1[20];
  laser laser_lv2;
  laser laser_lv3[128];
} CollisionProperty, *CollisionPropertyPtr;


typedef struct ObjData {
  int type;

  int tama_type;
  int charano;
  int task;
  int zorder;
  int number;
  int color;
  float angle;
  float x, y;
  float vx, vy;
  float w, h;
  float scalex, scaley;
  short middlex, middley;
} ObjData, *ObjDataPtr;


typedef struct ObjContainer {
  bool flag;
  int length;

  ObjData data[1];
} ObjContainer, *ObjContainerPtr;


CHARACTER * noaction(CHARACTER *p);
CHARACTER * delete_chara(CHARACTER *p);
void Bom(int x, int y, ObjDataPtr obj);
void Puttama(int type, float x, float y, ObjDataPtr tama);
void Putenemy(int charano, float x, float y, float vx, float vy, int task, ObjDataPtr obj);
void PutSprite(int zorder, short x, short y, int number, ObjDataPtr obj);
void DefSprite(int number, float w, float h, int color, ObjDataPtr obj);
void DefSpriteEx(int number, short middlex, short middley, ObjDataPtr obj);
void PutSpriteEx(int number, int x, int y, float scalex, float scaley, float angle, ObjDataPtr obj);

#endif