FighterDlg.h
资源名称:Fly ight.zip [点击查看]
上传用户:baina_li
上传日期:2013-03-23
资源大小:960k
文件大小:5k
源码类别:
射击游戏
开发平台:
Visual C++
- // FighterDlg.h : header file
- //
- #if !defined(AFX_FIGHTERDLG_H__1797712F_69C0_4ABD_AB1B_4BCE92F8E8D9__INCLUDED_)
- #define AFX_FIGHTERDLG_H__1797712F_69C0_4ABD_AB1B_4BCE92F8E8D9__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "MyButton.h"
- #define PIECE_SIDE 30
- #define BUTTON_INTERVAL_V 30
- #define BUTTON_INTERVAL_H 65
- #define FIGHTER_UNEXPLORE 0
- #define FIGHTER_HITDOWN 2
- #define FIGHTER_HIT 1
- #define FIGHTER_HITNULL 3
- #define FIGHTER_GUESS_HITNULL 4
- #define FIGHTER_GUESS_HIT 5
- #define FIGHTER_POSITION_NULL 6
- #define FIGHTER_POSITION_BODY 7
- #define FIGHTER_POSITION_HEADER 8
- #define FIGHTER_HEAD 2
- #define FIGHTER_BODY 1
- #define FIGHTER_NULL 0
- #define INFO_X 150
- #define INFO_Y 30
- #define FIGHTER_COMMENT_TIMER 1
- #define FIGHTER_WELCOME_TIMER 2
- #define FIGHTER_SCRROLTIME 55
- #define STATE_COLD 0
- #define STATE_HOT 1
- #define FIGHTER_RUNNING 1
- #define FIGHTER_STOP 2
- #define FIGHTER_POSITION 3
- typedef struct _Topten
- {
- char name[10][50];
- int bomb[10]; //共发炮弹数
- double hitpercentage[10]; //命中率
- }TOPTEN;
- typedef struct _SavePosition
- {
- DWORD dwVersion;
- int nSky[10][10];
- }SAVEPOSITION;
- #define WM_CLICK_TRAYICON WM_USER+991
- /////////////////////////////////////////////////////////////////////////////
- // CFighterDlg dialog
- class CFighterDlg : public CDialog
- {
- // Construction
- public:
- CDC m_memDC;
- // UINT m_nJPGWidth;
- // UINT m_nJPGHeight;
- // BYTE* m_pJPGBuf;
- // void ShowJPG(CDC *pDC);
- // void LoadJPG(CString filename);
- BOOL m_bShow;
- CString m_strBossFile;
- BOOL m_bSound;
- BOOL FileLink(LPCTSTR strPathObj, LPCTSTR strPathLink);
- BOOL IsEnterTopTen(int nBomb);
- TOPTEN m_TopTen;
- BOOL WriteRankFile(TOPTEN TopTen);
- BOOL ReadRankFile(TOPTEN* pTopTen);
- CRect m_rectNew;
- CRect m_rectOption;
- CRect m_rectPosition;
- CRect m_rectLoad;
- CRect m_rectQuit;
- CRect m_rectSave;
- CBitmap m_bmpNew;
- CBitmap m_bmpOption;
- CBitmap m_bmpPosition;
- CBitmap m_bmpLoad;
- CBitmap m_bmpQuit;
- CBitmap m_bmpSave;
- BOOL m_bLoadWelcomeString;
- int m_nGameStatus; //游戏是否开始
- BOOL m_bLoadFrame;
- CString m_strComment5;
- CString m_strComment4;
- CString m_strComment3;
- CString m_strComment2;
- CString m_strComment1;
- CRect m_rectCommentFrame; //fixed frame
- CPoint m_ptComment; //scroll(the rectangle to show Comment)
- CRect m_rectFighterDown;
- CRect m_rectBomb;
- CRect m_rectFighterHit;
- int m_nCommentTimer;
- int m_nWelcomeTimer;
- int m_nFighterHit;
- int m_nFighterDown;
- int m_nBomb;
- void DrawComment(CDC * pDC);
- CPoint m_ptNew;
- void DrawPiece(CDC * pDC, int x, int y, int nResult);
- void DrawShootingResult(CDC * pDC);
- int m_nShootingResult[10][10];
- int m_nSky[10][10];
- CRect m_rectSky;
- // void OnClickNew();
- // void OnClickPosition();
- // void OnClickSave();
- // void OnClickOption();
- // void OnClickLoad();
- // void OnClickQuit();
- BOOL m_bShowShootingCursor;
- BOOL m_bShowHandCursor;
- // CBitmap *m_pOldBitmap;
- // CBitmap m_FrameBitmap;
- // CDC m_MemDC;
- // CSize m_szPicture;
- IPicture *m_pPic;
- // IStream *m_pStm;
- // BOOL LoadBackground(LPCTSTR strFileName);
- // void DrawBackground();
- // CBitmap m_bmpFrame;
- CFighterDlg(CWnd* pParent = NULL); // standard constructor
- ~CFighterDlg();
- private:
- BOOL m_bByComputer;
- void EnterTopTen();
- int GetRand_10();
- int GetRand_4();
- HCURSOR m_hNewCursor;
- // HCURSOR m_hOldCursor;
- // Dialog Data
- //{{AFX_DATA(CFighterDlg)
- enum { IDD = IDD_FIGHTER_DIALOG };
- CMyButton m_ctrlLoad;
- CMyButton m_ctrlSave;
- CMyButton m_ctrlQuit;
- CMyButton m_ctrlOption;
- CMyButton m_ctrlPosition;
- CMyButton m_ctrlNew;
- //}}AFX_DATA
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CFighterDlg)
- public:
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- HICON m_hIcon;
- // Generated message map functions
- //{{AFX_MSG(CFighterDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- virtual void OnOK();
- virtual void OnCancel();
- afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- afx_msg void OnMenuShow();
- afx_msg void OnDestroy();
- afx_msg void OnMenuLoad();
- afx_msg void OnMenuQuit();
- afx_msg void OnMenuSave();
- afx_msg void OnMenuSound();
- afx_msg void OnButtonNew();
- afx_msg void OnButtonLoad();
- afx_msg void OnButtonOption();
- afx_msg void OnButtonPosition();
- afx_msg void OnButtonQuit();
- afx_msg void OnButtonSave();
- afx_msg void OnMenuHomepage();
- //}}AFX_MSG
- afx_msg void OnClickTrayIcon(WPARAM wParam,LPARAM lParam);
- DECLARE_MESSAGE_MAP()
- };
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_FIGHTERDLG_H__1797712F_69C0_4ABD_AB1B_4BCE92F8E8D9__INCLUDED_)