• 大小: 38KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-31
  • 语言: C/C++
  • 标签: 贪吃蛇  源码  

资源简介

游戏规则如下:  点击游戏->开始菜单游戏开始;  通过方向键控制蛇的运动方向,吃掉随机出现的豆子,若不小心碰到墙壁或者与自身相交,则该轮游戏结束;  点击 游戏->暂停按钮,暂停游戏;点击游戏->继续菜单,继续游戏;  点击设置->难度菜单,设定游戏难易程度;  点击游戏->结束菜单退出游戏。  单击帮助->游戏规则查看游戏规则

资源截图

代码片段和文件信息

// HungerSnake.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “HungerSnake.h“

#include “MainFrm.h“
#include “HungerSnakeDoc.h“
#include “HungerSnakeView.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CHungerSnakeApp

BEGIN_MESSAGE_MAP(CHungerSnakeApp CWinApp)
//{{AFX_MSG_MAP(CHungerSnakeApp)
ON_COMMAND(ID_APP_ABOUT OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
//    DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHungerSnakeApp construction

CHungerSnakeApp::CHungerSnakeApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CHungerSnakeApp object

CHungerSnakeApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CHungerSnakeApp initialization

BOOL CHungerSnakeApp::InitInstance()
{
AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
//  of your final executable you should remove from the following
//  the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T(“Local AppWizard-Generated Applications“));

LoadStdProfileSettings();  // Load standard INI file options (including MRU)

// Register the application‘s document templates.  Document templates
//  serve as the connection between documents frame windows and views.

CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CHungerSnakeDoc)
RUNTIME_CLASS(CMainframe)       // main SDI frame window
RUNTIME_CLASS(CHungerSnakeView));
AddDocTemplate(pDocTemplate);

// Parse command line for standard shell commands DDE file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);

// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;

// The one and only window has been initialized so show and update it.
m

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      29156  2008-03-30 22:24  贪吃蛇\HungerSnake\HungerSnake.aps

     文件       2301  2008-03-31 19:36  贪吃蛇\HungerSnake\HungerSnake.clw

     文件       4299  2008-03-30 17:14  贪吃蛇\HungerSnake\HungerSnake.cpp

     文件       4660  2008-03-30 17:14  贪吃蛇\HungerSnake\HungerSnake.dsp

     文件       1411  2008-03-30 17:14  贪吃蛇\HungerSnake\HungerSnake.h

     文件       1224  2008-04-01 10:59  贪吃蛇\HungerSnake\HungerSnake.plg

     文件      10623  2008-03-30 17:14  贪吃蛇\HungerSnake\HungerSnake.rc

     文件       1842  2008-03-30 17:14  贪吃蛇\HungerSnake\HungerSnakeDoc.cpp

     文件       1530  2008-03-30 17:14  贪吃蛇\HungerSnake\HungerSnakeDoc.h

     文件       7587  2008-04-01 11:00  贪吃蛇\HungerSnake\HungerSnakeView.cpp

     文件       2315  2008-03-31 21:58  贪吃蛇\HungerSnake\HungerSnakeView.h

     文件       2515  2008-03-30 22:24  贪吃蛇\HungerSnake\MainFrm.cpp

     文件       1581  2008-03-30 17:14  贪吃蛇\HungerSnake\MainFrm.h

     文件       4431  2008-03-30 17:14  贪吃蛇\HungerSnake\ReadMe.txt

     文件       1078  2008-03-30 17:14  贪吃蛇\HungerSnake\res\HungerSnake.ico

     文件        403  2008-03-30 17:14  贪吃蛇\HungerSnake\res\HungerSnake.rc2

     文件       1078  2008-03-30 17:14  贪吃蛇\HungerSnake\res\HungerSnakeDoc.ico

     文件       1078  2008-03-30 17:14  贪吃蛇\HungerSnake\res\Toolbar.bmp

     文件        499  2008-03-30 17:14  贪吃蛇\HungerSnake\Resource.h

     文件        213  2008-03-30 17:14  贪吃蛇\HungerSnake\StdAfx.cpp

     文件       1054  2008-03-30 17:14  贪吃蛇\HungerSnake\StdAfx.h

     文件        559  2008-03-30 17:14  贪吃蛇\贪吃蛇.dsw

     文件      66560  2008-04-01 11:00  贪吃蛇\贪吃蛇.ncb

     文件      53760  2008-04-01 11:00  贪吃蛇\贪吃蛇.opt

     目录          0  2008-03-30 17:14  贪吃蛇\HungerSnake\res

     目录          0  2008-04-01 11:00  贪吃蛇\HungerSnake

     目录          0  2008-04-01 11:00  贪吃蛇

----------- ---------  ---------- -----  ----

               201757                    27



............此处省略0个文件信息

评论

共有 条评论