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

📄 gamewnd.h

📁 Embedded VC “是男人就挺过二十秒”源代码
💻 H
字号:
// GameWnd.h: interface for the CGameWnd class.
//
/**///////////////////////////////////////////////////////////////////////
#ifndef GAMEWND_H
#define GAMEWND_H

#include "Bullets.h"
#include "Plane.h"
#include "Text.h"

class CGameWnd  
{
public:
    BOOL ShowWindow(BOOL bShow);
    BOOL Initialize(HINSTANCE hInst);
    static CGameWnd * GetInstance();
    virtual ~CGameWnd();
protected:
    void CheckMenu();
	void MenuItemsControl(bool bStart);
    void OnMenuLevel(int iLevel);
    void OnCreate(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam);
    void SetSkewingOnKey();
    void OnKeyUp(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
    void OnKeyDown(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
    void OnLButtonUp(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam);
    void OnLButtonDown(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam);
    void OnMouseMove(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam);
    void EndGame();
    static DWORD WINAPI RefreshScreenThread(PVOID pArg);
    void StartGame();
    void OnPaint(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam);
    void OnDestroy(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam);
    static LRESULT WndProc(HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam);
    CGameWnd();
    
    static CGameWnd * m_pInstance;
    HINSTANCE m_hInst;
    HWND m_hWnd;
    RECT m_rcWndPlay;        //The window to play the game, be base on the window scale
    RECT m_rcWndMain;        //The main window
    CBullets m_Bullets;
    CPlane m_Plane;
    BOOL m_bMovePlane;            //Move the plane or not
    BOOL m_bCollide;		//碰撞
    POINT m_ptPlaneSkewing;        //The next point to moveto for the plane
    HWND m_hWndCB;            //Command bar
    ULONG m_ulTimeCount;        //The continue time count
    CText m_TxtTime;

    //The game setting data
    typedef struct
    {
        //For the plane
        int iPlaneMoveDistance;        //The distance to move per acttion
        
        //For the bullet
        int iBulletMaxMoveDistance;    //The max distance to move
        int iBulletCount;            //The count of bullets

        //For the game 
        int iRefreshInterval;        //The interval time to refresh screen
    }SETTINGDATA,*LPSETTINGDATA;
    SETTINGDATA m_Setting;

    //The key pushed status
    typedef struct
    {
        BOOL bPushKeyUp;
        BOOL bPushKeyDown;
        BOOL bPushKeyLeft;
        BOOL bPushKeyRight;
    }PUSHKEYSTATUS,*LPPUSHKEYSTATUS;
    PUSHKEYSTATUS m_KeyStatus;
};



#endif // #ifndef GAMEWND_H

⌨️ 快捷键说明

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