-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinvader.h
More file actions
98 lines (76 loc) · 1.42 KB
/
Copy pathinvader.h
File metadata and controls
98 lines (76 loc) · 1.42 KB
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
/* [ASCII Invader]
* File: invader.h
* Description: オブジェクト構造体定義ヘッダー
* Author: Yuta KOBAYASHI
* Copyright: (C)Hayato OKUMOTO, Yuta KOBAYASHI. 2013
*/
#include <stdio.h>
#include <stdlib.h>
#include <curses.h>
#include <signal.h>
#include <locale.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#include "network.h"
#include "game.h"
#define PORT (in_port_t)50000
#define HOSTNAME_LENGTH 64
// ウィンドウ
#define WIN_WIDTH 100
#define WIN_HEIGHT 30
// breakフラグの定数
#define BREAK 1
#define NON_BREAK 0
// キー定数
#define KEY_SPACE ' '
#define K_QUIT 'q'
// ゲーム要素定数
#define ENEMY_X_MAX 7
#define ENEMY_Y_MAX 7
#define ENEMY_NUM (ENEMY_X_MAX * ENEMY_Y_MAX)
#define ENEMY_MOVE_RATE 10
// 左右方向の単位ベクトル
#define D_LEFT -1
#define D_RIGHT 1
// 更新レート
#define FPS (clock_t)(CLOCKS_PER_SEC / 60)
// 2次のベクトル構造体 VECT
typedef struct {
int x;
int y;
} VECT;
// 座標型POS
typedef VECT POS;
//弾
typedef struct {
POS pos;
int active;
int velocity;//速度
int sorce;//現在の親
} BULLET;
//自機
typedef struct {
POS pos;
BULLET bullet; // 撃てる弾(1発)
int score;
} PLAYER;
//相手
typedef struct {
POS pos;
int active;
int type; //種類
int point;
} ENEMY;
//UFO
typedef struct
{
int x;
int endure;
int life;
} UFO;
//ガード(トーチカ)
typedef struct
{
POS pos;
} WALL;