?? dragon.h
字號:
// DRAGON.h: interface for the DRAGON class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DRAGON_H__9AFD0E69_461D_4A0D_BF4C_F37D704ED9D3__INCLUDED_)
#define AFX_DRAGON_H__9AFD0E69_461D_4A0D_BF4C_F37D704ED9D3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
////////////////////////////////// 注:龍的身體是以單向雙鏈表構造
////////////////////////////////// 目地是方便對每個節點的控制.
////////////////////////////////// 并設置頭指針(*first),尾指針(*tail)
////////////////////////////////// 控制龍的移動
class DRAGON
{
/////////////公有變量//////////////
public:
BOOL IsDead; //是否死亡標志
int Direction; //方向標志,1=up,2=down,3=left,4=right
int Lenth; //龍體長
int Width; //龍體寬(龍單位的像素)
void Move(); //移動函數
DRAGON();
virtual ~DRAGON();
//////////////////////////////////
private:
/////////////////龍的單位體//////////////
class DRAGONNODE
{
public:
DRAGONNODE();
int x; //單位體X坐標
int y; //單位體y坐標
DRAGONNODE *llink,*rlink;
};
////////////////////////////////////////
public:
void Init(); //初始化
void Eat(); //
BOOL IsBody(int x,int y);
void DgnMove();
int GetY(int nflag);
int GetX(int nflag);
void RightMove();
void LeftMove();
void DownMove();
void UpMove();
DRAGONNODE *first,*tail;
};
#endif // !defined(AFX_DRAGON_H__9AFD0E69_461D_4A0D_BF4C_F37D704ED9D3__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -