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

📄 tank2003.cpp

📁 坦克游戏
💻 CPP
字号:
// Tank2003.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "Tank2003.h"
#include "MainGame.h"

/////////////////////////////////////////////////////////////////////////////
// CTank2003App

BEGIN_MESSAGE_MAP(CTank2003App, CWinApp)
	//{{AFX_MSG_MAP(CTank2003App)
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTank2003App construction

CTank2003App::CTank2003App()
{
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CTank2003App object

CTank2003App theApp;

/////////////////////////////////////////////////////////////////////////////
// CTank2003App initialization

BOOL CTank2003App::InitInstance()
{
	srand(time(NULL));
	CMainGame *pWnd=new CMainGame();
    pWnd->Create("Tank2003");
    m_pMainWnd = pWnd;	
	if(pWnd->InitializeWnd(640,480,16)==FALSE)
    {
        pWnd->DestroyWindow();
        return FALSE;
    }
	

    MSG msg;
    while(TRUE)
    {
        if(PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))//如果有消息就处理消息
        {
            if(!GetMessage(&msg,NULL,0,0))
                return msg.wParam;
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
		else 
		{
			pWnd->GameFight();
		}
	}
	return FALSE;
}

⌨️ 快捷键说明

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