⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sprite.h

📁 疯狂坦克源代码
💻 H
字号:

typedef void (*LPSTATE) (struct tank* node);

typedef struct tank
{  
 struct tank *prev;
 struct tank *next;
 int frame;//当前帧
 int x;
 int y;  //当前坐标
 BYTE type;//类型
 int speedx;
 int speedy;//速度
 int speed;//子弹速度
 BYTE status;//当前状态0:出生1:保护2:正常
 int life;//生命
 int force;//破坏力
 DWORD timeborn;//创建时间
 DWORD timefire;//开火时间
 DWORD timeupdate;//刷新时间
 DWORD timestart;//出生或无敌开始时间
 DWORD superupdate;//无敌刷新时间
}TANK;

typedef TANK* LPTANK;

typedef struct otank
{
 int frame;//当前帧
 int x;
 int y;  //当前坐标
 BYTE type;//类型
 int speedx;
 int speedy;//速度
 int speed;//子弹速度
 BYTE CtrlD;//按什么方向键
 BYTE CtrlF;//按开火键
 BYTE status;//当前状态0:出生1:保护2:正常3:长保护
 int life;//生命
 int lifenum;//坦克数
 DWORD score;//分数
 BYTE tank[4];//消灭的各类坦克数
 int force;//破坏力
 int bornd;//出生动画方向
 DWORD timefire;//开火时间
 BYTE firenum;//在外炮弹数
 BYTE firemaxnum;//在外最大炮弹数
 DWORD timeupdate;//刷新时间 
 DWORD timestart;//出生或无敌开始时间
 DWORD superupdate;//无敌刷新时间
}OTANK;

typedef OTANK* LPOTANK;

typedef struct shot
{
 struct shot *prev;
 struct shot *next;
 int frame;//当前帧
 int x;
 int y;  //当前坐标
 BYTE type;//类型
 int speedx;
 int speedy;//速度
 int force;//破坏力
 DWORD timeupdate;//刷新时间
}SHOT;

typedef SHOT* LPSHOT;

typedef struct appl//物品
{
 struct appl *prev;
 struct appl *next;
 int frame;
 int x;
 int y;
 BYTE valid;
 BYTE type;
 DWORD timeupdate;
}APPL;

typedef APPL* LPAPPL;

typedef struct map//地图
{
 char name[128];
 BYTE offset;
 BYTE tank[4];//各类坦克数量
 BYTE tanknum;//同现敌方坦克数
 BYTE array[36][46];//地图
}MAP;

typedef struct treepos//树和水的位置
{
 int x;
 int y;
 struct treepos *next;
}TREE;

typedef TREE* LPTREE;

typedef struct config//配置
{
 DWORD stage;
 int playernum;
 int speed;
 DWORD mode;//游戏模式
 DWORD borntime;//出生状态时间
 DWORD supertime;//保护时间
 DWORD stime;//长保护时间
 UINT p1up;
 UINT p1down;
 UINT p1left;
 UINT p1right;
 UINT p1fire; 
 UINT p2up;
 UINT p2down;
 UINT p2left;
 UINT p2right;
 UINT p2fire;  
 UINT select;
 UINT start;
 UINT pause; 
}CONFIG;

typedef struct gmode//游戏当前状态
{
 int tanknum;//当前同现敌方坦克数
 int stage;//当前关数
 BYTE gamestatus;//当前游戏状态
 BYTE status;//特殊状态
 BOOL isplay;//背景音乐是否在播放
 DWORD timestart;//特效开始时间
}MODE;
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -