• 大小: 18.67MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-03
  • 语言: C/C++
  • 标签:

资源简介

实现了飞机游戏的基本功能,有关卡,boss,等等基本功能

资源截图

代码片段和文件信息

// AircraftGame.cpp : Defines the entry point for the application.
//

#include “stdafx.h“
#include “AircraftGame.h“
#include “GameControler.h“

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst; // current instance
TCHAR sztitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name

// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE int);
LRESULT CALLBACK WndProc(HWND UINT WPARAM LPARAM);
INT_PTR CALLBACK About(HWND UINT WPARAM LPARAM);


#include “GameControler.h“
CGameControler *pGameControl = NULL;
HDC g_hdc;

int APIENTRY _tWinMain(HINSTANCE hInstance
                     HINSTANCE hPrevInstance
                     LPTSTR    lpCmdLine
                     int       nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

  // TODO: Place code here.
MSG msg;
ZeroMemory(&msg sizeof(MSG));
HACCEL hAccelTable;

// Initialize global strings
LoadString(hInstance IDS_APP_title sztitle MAX_LOADSTRING);
LoadString(hInstance IDC_AIRCRAFTGAME szWindowClass MAX_LOADSTRING);
MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance nCmdShow))
{
return FALSE;
}

hAccelTable = LoadAccelerators(hInstance MAKEINTRESOURCE(IDC_AIRCRAFTGAME));


//游戏循环
while (msg.message != WM_QUIT)
{

if (PeekMessage(&msg NULL 0 0 PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
//if(msg.message != KEYDOWN(ESCAPE))
 if(!CGameControler::IsPause)
pGameControl->UpdateScence();//游戏开始
}

pGameControl->Exit();

return (int) msg.wParam;
}



//
//  FUNCTION: MyRegisterClass()
//
//  PURPOSE: Registers the window class.
//
//  COMMENTS:
//
//    This function and its usage are only necessary if you want this code
//    to be compatible with Win32 systems prior to the ‘RegisterClassEx‘
//    function that was added to Windows 95. It is important to call this function
//    so that the application will get ‘well formed‘ small icons associated
//    with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);

wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance MAKEINTRESOURCE(IDI_AIRCRAFTGAME));
wcex.hCursor = LoadCursor(NULL IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_AIRCRAFTGAME);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance MAKEINTRESOURCE(IDI_SMALL));

return RegisterClassEx(&wcex);
}

//
//   FUNCTION: InitInstance(HINSTANCE int)
//
//   PURPOSE: Saves instance handle and creates main w

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-11-17 16:08  AircraftGame\
     目录           0  2012-11-17 16:07  AircraftGame\AircraftGame\
     文件    28397568  2012-11-17 16:08  AircraftGame\AircraftGame.sdf
     文件         903  2012-05-08 23:17  AircraftGame\AircraftGame.sln
     文件       57344  2012-11-17 16:08  AircraftGame\AircraftGame.suo
     文件       52608  2012-11-14 11:26  AircraftGame\AircraftGame\AircraftGame.aps
     文件        5368  2012-11-17 16:03  AircraftGame\AircraftGame\AircraftGame.cpp
     文件          39  2012-05-08 23:17  AircraftGame\AircraftGame\AircraftGame.h
     文件       23558  2009-08-31 02:31  AircraftGame\AircraftGame\AircraftGame.ico
     文件        7350  2012-11-14 11:26  AircraftGame\AircraftGame\AircraftGame.rc
     文件        5522  2012-11-17 15:41  AircraftGame\AircraftGame\AircraftGame.vcxproj
     文件        3615  2012-11-17 15:41  AircraftGame\AircraftGame\AircraftGame.vcxproj.filters
     文件         143  2012-05-08 23:17  AircraftGame\AircraftGame\AircraftGame.vcxproj.user
     文件        1171  2012-11-17 09:15  AircraftGame\AircraftGame\Bullet.cpp
     文件         761  2012-11-17 08:41  AircraftGame\AircraftGame\Bullet.h
     文件         388  2012-11-17 15:41  AircraftGame\AircraftGame\ClassDiagram1.cd
     文件           1  2009-08-31 02:32  AircraftGame\AircraftGame\ClassDiagram2.cd
     目录           0  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\
     文件        2403  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.Build.CppClean.log
     文件         406  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.exe.embed.manifest
     文件         472  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.exe.embed.manifest.res
     文件         381  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.exe.intermediate.manifest
     文件          51  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.lastbuildstate
     文件        5459  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.log
     文件       36191  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.obj
     文件     4456448  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.pch
     文件    12451840  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.pchast
     文件       48308  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame.res
     文件         214  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\AircraftGame_manifest.rc
     文件       12440  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\Bullet.obj
     文件        8490  2012-11-17 16:02  AircraftGame\AircraftGame\Debug\cl.command.1.tlog
............此处省略86个文件信息

评论

共有 条评论

相关资源