📄 ghostthread.h
字号:
#if !defined(AFX_GHOSTTHREAD_H__DED02AB5_E671_4ED0_8651_3B8ED1C0390C__INCLUDED_)
#define AFX_GHOSTTHREAD_H__DED02AB5_E671_4ED0_8651_3B8ED1C0390C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GhostThread.h : header file
//
//////////////////////////////////////////////////////////////////////////
// 拨浪鼓
// anfysky@163.com
//////////////////////////////////////////////////////////////////////////
extern enum GhostStates
{
ALIVE,
LOCKED,
GHOSTDEAD
};
/////////////////////////////////////////////////////////////////////////////
// CGhostThread thread
class CGhostThread : public CWinThread
{
DECLARE_DYNCREATE(CGhostThread)
protected:
// Attributes
public:
int m_iHurryCount;
void InitiateDCs(BOOL bHumanCtrl, int iIndex, CDC* pDC);
int m_iLifeLeft;
ULONG m_lScore;
int m_iLockedBMPIndex;
int m_iBubbleRadius;
void MakeDirect(double iX, double iY, double r);
CBitmap* m_pDeadMemBMP[16];
CBitmap* m_pLockedMemBMP[5];
enum GhostStates m_eState;
int m_iLeftBubbleNum,m_iBubbleNum;
int m_iLastBubbleIndex;
BOOL m_bSetBubbleNotLeave;
BOOL WillGoIntoBubble(int* direct);
BOOL m_bHumanCtrl;
int m_iHeight;
int m_iWidth;
BOOL WillGoIntoGhost(int* direct);
BOOL WillGoIntoObstacle(int * direct);
BOOL WillGoOut(int * direct);
int m_iIndex,m_iWaittime;
CGhostThread(); // protected constructor used by dynamic creation
virtual ~CGhostThread();
int Run();
int m_iFrameCount;
int m_iPartHeight;
int m_iPartWidth;
CBitmap* m_pPartMemBMP[24];
CDC* m_pPartMemDC;
CDC* m_pPartImageMemDC;
CDC* m_pDC;
void Go(int iDirect,double speed);
void SetGhost(int bubblenum, double x, double y, int direct, double speed, int waittime);
// BOOL m_bAlive;
double m_x,m_y,m_fSpeed;
int m_iType,m_iDirect;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGhostThread)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CGhostThread)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GHOSTTHREAD_H__DED02AB5_E671_4ED0_8651_3B8ED1C0390C__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -