登录
首页 » Windows开发 » 迷宫追寻小游戏 C++MFC

迷宫追寻小游戏 C++MFC

于 2022-03-23 发布 文件大小:2.58 MB
0 228
下载积分: 2 下载次数: 1

代码说明:

应用背景 这个游戏为玩家控制红色方块,去吃掉棕色,绿色,蓝色的方块,一旦一个方块被吃,便会自动生成另一个相同颜色的方块。直到游戏时间结束为止。 程序函数功能: ondraw函数: 显示游戏界面(用画刷刷成白色),显示地图(黑色),显示食物0,1,2(分别为:棕色,绿色,蓝色),显示玩家(红色) 显示文字,时间,分数。 OnEraseBkgnd函数: 用来更新窗口背景,游戏以位图为窗口背景。 OnGameStart函数: 关联窗口菜单中的开始游戏。包括:     IniGame();(初始化游戏)     m_nGameStatus=1;(游戏状态1,开始)     SetTimer(1,100,NULL);(定时器0.1秒执行一次OnTime)     Invalidate();(转向OnDraw) IniGame函数: 初始化游戏,确定游戏显示位置,确定玩家初始位置,转向IniAim函数 IniAim函数: 初始化目标,这里的三个目标的位置为随机产生。 OnKeyDown函数: 监控设备按下的键,确定玩家移动方向。 ReDisPlay函数: 重画点所在的小方块。减少对Invalidate()的调用,使屏幕不太闪硕。 OmTimer函数: 完成时间的计算。 关键技术游戏中的人工智能: 棕色方块的移动算法为基本寻路算法—物体沿着墙走。 绿色方块的移动算法为基本的逃避算法—物体总会向玩家的反方向移动。 蓝色方块的移动算法为漫游算法—随机产生一个方向值,物体移动的方向不

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 小游戏本人自己的一款小游戏,请大家多多指教了饿,不胜感激了
    小游戏本人自己开发的一款小游戏,请大家多多指教了饿,不胜感激了-Game I own a game, please advise the U.S. more hungry, be grateful for the
    2022-02-05 16:08:35下载
    积分:1
  • 哈哈将哈哈哈哈哈哈哈哈哈哈哈哈斤斤计较斤斤计较斤斤计较...
    哈哈将哈哈哈哈哈哈哈哈哈哈哈哈斤斤计较斤斤计较斤斤计较-fghjkl
    2022-01-25 20:28:48下载
    积分:1
  • 进程指挥官
    进程指挥官--进程控制源代码.process manager!-The process of commanders- the process of controlling the source code. Process manager!
    2022-07-24 17:11:14下载
    积分:1
  • 这是继Effective C++后的一本书,More Effective C++主要讲解了一些效率,异常等问题。...
    这是继Effective C++后的一本书,More Effective C++主要讲解了一些效率,异常等问题。-This is the second Effective C++ After a book, More Effective C++ Mainly on a number of efficiency, anomalies and other issues.
    2022-10-23 15:20:03下载
    积分:1
  • 使剪贴板是系统中个进程共享的一块重要区域。在不同的应用程序之间传送数据的时候,首要的选择就是利用剪贴板。不仅如此,在同一个程序的不同窗体之间拷贝数据的时候也常常...
    使剪贴板是系统中个进程共享的一块重要区域。在不同的应用程序之间传送数据的时候,首要的选择就是利用剪贴板。不仅如此,在同一个程序的不同窗体之间拷贝数据的时候也常常使用剪贴板。剪贴板是视窗操作系统中不可缺少的一部分。本程序演示了如何访问剪贴板中的各种数据。用VC访问剪贴板源程序-so clipboard system is out of a process of sharing important region. In different applications transmission of data between the time, the first option is the use of the clipboard. Not only that, with a program to copy between different forms of data often use the clipboard. Windows clipboard is an indispensable part. This program demonstrated how to access the clipboard data. VC visit clipboard source
    2022-11-18 10:40:03下载
    积分:1
  • TI的TMS320LF2407芯片的测试程序
    ti tms320lf2407的测试程序-ti tms320lf2407 testing procedures
    2022-07-27 06:44:31下载
    积分:1
  • vc commonly used data format conversion, such as wchar_t, char*, CString, int, e...
    vc中常用数据格式转换,如wchar_t,char*,CString,int等。-vc commonly used data format conversion, such as wchar_t, char*, CString, int, etc..
    2023-01-12 13:25:03下载
    积分:1
  • 单报数据加密,在文件传输时对数据报进行加密,此程序为客户端程序...
    单报数据加密,在文件传输时对数据报进行加密,此程序为客户端程序-Single-reported data encryption in the file transfer when the data is encrypted reported that this procedure for the client program
    2022-07-11 23:41:02下载
    积分:1
  • Loc1.0 the software version. Purpose : Major private document browser toolbar, p...
    本软件为Loc1.0版。 目的: 主要对私人文档的浏览工具,其私人文档只能用该软件才能正确浏览。 使用: 请将该软件的LocSee文件夹以及内部文件拷贝到A:磁盘根目录下, 切勿更改路径,否则后果自负。 软件使用前,请先运行LocReg.exe对程序进行注册。 MyDoc.exe为主程序,他可以将文本文件转化为Loc文档(即加密文档) 注册后,点击Loc文档将直接调入该程序。 作用: 如果将该程序拷贝到其他磁盘运行,该程序将不仅不能正常运行,而且 会自动销毁。同时会删除当前目录下的所有Loc文档。 本软件暂时免费,仅供学习讨论,若要更加完善,加强加密保护,请与本人 联系。 联系电话:0745-2383298 Email:langel197881@yahoo.com.cn 个人网站: langel.ruin.cn-Loc1.0 the software version. Purpose : Major private document browser toolbar, private documents can only use the software to ensure the proper browser. Use : Please software LocSee this folder and copy of the internal document A : disk root directory, the path not to change, otherwise bear the consequences themselves. The use of the software before running post LocReg.exe right registration procedures. MyDoc.exe mainly procedures, he can be transformed into text files for Loc documents (that is, encrypted files) After registration, click Loc document will be directly transferred to the program. Role : If this program copied to oth
    2022-01-25 17:27:55下载
    积分:1
  • 一个好用的线程池
    一个好用的线程池 -a user-friendly Thread Pool
    2022-02-24 20:20:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载