<<ヘッダファイル解説>> <<>> #pragma once #include #include #include "enemy_bullet.h" typedef struct boss{ GdkPixbuf *image; //ボスの画像 float x; //x座標 float y; //y座標 float width; //幅 float height; //高さ int hp, hp_max; //体力、最大値 double xrad; double yrad; int pattern; }Boss; Boss boss[4];//とりあえずボスは4体 Bullet boss_bullet[BLTMAX]; void boss_move(int i);//ボスの動き void Appear(int i); void MovePattern1(int i); void MovePattern2(int i); void boss_draw(cairo_t *cr, int i);//ボスの描画 void boss_hit(double x, double y, int i);//あたり判定 void boss_bullet_init(); void boss_bullet_dir(float x,float y); void boss_bullet_n_way(float x,float y,int n); void boss_bullet_spiral(float x,float y,int n); void boss_bullet_back_spiral(float x,float y,int n); void boss_bullet_draw(cairo_t *cr, int i); void boss_bullet_main(cairo_t *cr); void boss_bullet_move(cairo_t *cr); <<>> <<>> <<>> #pragma once #include "jiki.h" // 定義 #define GANCHAN_SHOT_STRUCT_MAX 750 /* 何個弾(及び光線)を発射するか */ /* 弾の種類ごとの画像の宣言 */ GdkPixbuf *shot_image; GdkPixbuf *beam_l_image; GdkPixbuf *beam_m_image; GdkPixbuf *beam_h_image; // 弾の情報を格納する構造体の宣言 typedef struct{ /* 弾のx座標 */ double x; /* 弾のy座標 */ double y; /* 弾のx方向速度 */ int dx; /* 弾のy方向速度 */ int dy; /* 弾の発射状態(1なら発射している、0なら発射されていない) */ int shoot_flag; /* 弾の種類(1ならビーム、0ならショット) */ int beam_flag; /* 弾の威力 */ int strength; /* 光線の威力 */ int b_strength; /* 弾の画像 */ GdkPixbuf *image; }ganchan_shot_struct; ganchan_shot_struct bullet[GANCHAN_SHOT_STRUCT_MAX]; extern int power_sum; // 関数の宣言 void ganchan_shot_struct_init(void); //弾の位置などの初期化 ゲームを始める際に呼び出す void ganchan_shot_struct_coninit(void); //弾の位置などの再読み込み コンティニュー時に呼び出す void ganchan_shot_struct_shot_player(void); //主人公の弾の生成 弾配列を操作 void ganchan_shot_struct_beam_player(void); //主人公の光線の生成 void ganchan_shot_struct_move(void); //弾の移動 void ganchan_shot_struct_draw(cairo_t *cr); //弾の描画 void ganchan_shot_struct_delete(int i); //弾の消去 void ganchan_shot_struct_power(int p); //弾の強化についての関数 void ganchan_shot_struct_power_rem(void); //弾の強化状態の記憶 void shot_main(int z,int x,int c,cairo_t *cr); /* ここから派生 */ /* bulletの値を返す関数 */ double ganchan_shot_struct_x(int num); double ganchan_shot_struct_y(int num); double ganchan_shot_struct_width(int num); double ganchan_shot_struct_height(int num); int ganchan_shot_struct_shoot_flag(int num); int ganchan_shot_struct_beam_flag(int num); int ganchan_shot_struct_shot_strength(int num); int ganchan_shot_struct_beam_strength(int num); <<>> #pragma once #include #include #include #define ITEM_MAX 1027 /* 弾の種類ごとの画像の宣言 */ GdkPixbuf *huka_image; // 0以下 GdkPixbuf *kry_image; // 1 2 3 GdkPixbuf *syuu_image; // 4 GdkPixbuf *bomb_image; // 5 GdkPixbuf *ext_image; // 6 GdkPixbuf *scr_image; // 7 double item_width; double item_height; //アイテムの情報を格納する構造体の宣言 typedef struct{ /* アイテムのx座標 */ double x; /* アイテムのy座標 */ double y; /* アイテムの使用フラグ */ int flag; /* アイテムの落下速度 */ double x_fall; double y_fall; /* アイテムの種類 */ int type; /* アイテムの画像 */ GdkPixbuf *image; }Item; Item item[ITEM_MAX]; int power; /* 弾の強化段階 */ extern int tan_i; /* 単位取得状況 */ extern int score; /* 得点 */ int get_flag; /* アイテムとの接触判定 */ // 関数の宣言 void item_init(void); //アイテムについての初期化 void item_player(float x,float y,int t); //アイテムの生成 void item_move(void); //アイテムの移動 void item_draw(cairo_t *cr); //アイテムの描画 void item_delete(int i,int f,int t); //アイテム消滅の関数 void item_count(void); //単位の獲得についての関数 void ganchan_bomb(void); //ボムの追加についての関数 void ganchan_ext(void); //残機の追加についての関数 void game_score(void); //得点の増加についての関数 void itaissu(void); //被弾時に呼ぶ関数 単位に関係 void itakunai(void); //コンティニュー時の被弾数の初期化 void item_main(float x,float y,int t); //アイテムのだいじな関数 /* itemの値を返す関数 */ double item_x(int num); double item_y(int num); double item_fall(int num); int item_power(int num); int item_type(int num); <<>> #pragma once #include #include #include typedef struct{ GdkPixbuf *image; //自機の画像 GdkPixbuf *hit; //被弾エフェクト double x; //x座標 double y; //y座標 double width; //自機の幅 double height; //自機の高さ int bomb; //ボムの個数 int zanki; //残機 double speed; //速度 }Jiki; extern int hit_time; Jiki jiki; void jiki_new(); void jiki_move(); //自機の移動 void jiki_draw(cairo_t *cr); //自機の描画 void jiki_bomb(); //ボム void jiki_hit(); //被弾処理 int respawn_time();//無敵時間 double jiki_x(); // 自機の中央のx座標を返す double jiki_y(); // 自機の中央のy座標を返す double jiki_width(); // 自機の幅を返す double jiki_height(); // 自機の高さを返す int jiki_zanki(); // 自機の残機を返す <<>> extern int right_key_flag; extern int left_key_flag; extern int up_key_flag; extern int down_key_flag; extern int deceleration_flag; extern int z_key_flag; extern int x_key_flag; extern int c_key_flag; extern int c_hold; extern int shot_count; gboolean key_press(GtkWidget *widget,GdkEventKey *event,gpointer user_data); gboolean key_release(GtkWidget *widget,GdkEventKey *event,gpointer user_data);