资源简介
游戏规则如下:
点击游戏->开始菜单游戏开始;
通过方向键控制蛇的运动方向,吃掉随机出现的豆子,若不小心碰到墙壁或者与自身相交,则该轮游戏结束;
点击 游戏->暂停按钮,暂停游戏;点击游戏->继续菜单,继续游戏;
点击设置->难度菜单,设定游戏难易程度;
点击游戏->结束菜单退出游戏。
单击帮助->游戏规则查看游戏规则
代码片段和文件信息
// 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个文件信息
- 上一篇:DH算法代码实现
- 下一篇:MFCC梅尔倒谱参数及matlab代码
相关资源
- 开放源码的计算机图形学几何算法包
- c++实现四则运算器源码 支持括号
- c语言实现字典顺序排序
- 一个双色球彩票随机选号器6+1C++源码
- 数据结构约瑟夫环实习报告及源码
- tcp socket实现单进程单线程 高并发服务
- 摄影测量空间后方交会程序合集,含
- 实现最近点对问题源的代码(C语言)
- 板材切割c源码
- 人工智能旅行商问题实验报告及C++源
- 远程桌面源码
- funcode 打飞虫c语言源码
- 《C语言程序开发范例宝典》光盘源码
- 51单片机直流电机控制C语言代码.rar
- 哈夫曼编码与解码(C语言实现)
- QT C++ 算法 广搜BFS 最小步数解二阶魔
- VC++压缩解压zip文件支持密码
- C图像读写源代码.zip
- C语言课程设计大作业-学生管理系统含
- 山大C++实验
- 基于vc6.0串口调试助手源码
- c++音频原始数据PCM采样率转换-源码和
- 读取串口数据并画出曲线图的VC++程序
- 打砖块C++源码
- 连连看游戏C语言代码
- C语言 3DES、AES、RC6、TEA、RSA、MD5、S
- 完全用API构成的串口串试助手VC6源码
- Windows内存清理工具实现含源码及程序
- 达内科技 c++ 课件与笔记
- MFC 贪吃蛇
评论
共有 条评论