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

迷宫追寻小游戏 C++MFC

于 2022-03-23 发布 文件大小:2.58 MB
0 227
下载积分: 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 个回复

  • 2004080421463717239Win2K目录共享源码,从事WINDOWS系统工程师
    2004080421463717239Win2K目录共享源码,从事WINDOWS系统开发工程师-2004080421463717239Win2K catalog share sound codes which can be used for engaging WINDOWS system explore engineerings
    2022-02-03 18:27:05下载
    积分:1
  • RTL8139网卡驱动程序源代码为WinCE.NET CEPC
    RTL8139 网卡驱动源码 for WinCE.net CEPC-RTL8139 NIC driver source code for WinCE.net CEPC
    2022-08-08 20:28:27下载
    积分:1
  • Android实现自动、手动更新应用
    代码简单、易懂、实用。 import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import android.app.AlertDialog; import android.app.Dialog; import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnClickListener; import android.content.pm.PackageManager.NameNotFoundException; import android.net.Uri; import android.os.Environment; import android.os.Handler; import android.os.Message; import android.view.LayoutInflater; import android.view.View; import android.widget.ProgressBar; import android.widget.Toast; /** *@author coolszy *@date 2012-4-26 *@blog http://blog.92coding.com */ public class UpdateManager { /
    2022-03-30 02:32:04下载
    积分:1
  • 针对430单片机IO模拟I2C源程序,程序经过测试,使用工具为IAR
    针对430单片机IO模拟I2C源程序,程序经过测试,使用工具为IAR-430 I2C
    2022-10-19 05:55:03下载
    积分:1
  • 许可证选项文件,并可替换名为程序的用户。是否认为…
    License Options file and may replace Named Users for a Program, whether temporarily or not, no more than four (4) times per year, prov file never exceeds the number licensed per Program. Portions of the Programs may be installed on individual computers to accelerate startup times, as long as the-License Options file and may replace Named Users for a Program. whether temporarily or not. no more than four (4) times per year. 577 file never exceeds the number licensed per Program. Portions of the Programs may be instal led on individual computers to accelerate star tup times, as long as the
    2022-12-16 11:35:03下载
    积分:1
  • 这是一个简单的C语言,一个漂亮的界面,应用程序可以快速提高…
    这是一个C语言的简单、可观的一个界面,应用它能够快速的提高我们的编程水平-This is a simple C language, a handsome interface, applications can quickly improve our level of programming
    2022-02-06 17:20:21下载
    积分:1
  • IE风格的编辑框
    IE风格的编辑框-IE-style editing Box
    2023-08-17 05:05:03下载
    积分:1
  • 支持便携式网络图形格式的参考库
    支持便携式网络图形格式的参考库-support the Portable Network Graphics format reference library
    2022-07-10 14:12:16下载
    积分:1
  • regular automatic shutdown procedures
    定时自动关机程序-regular automatic shutdown procedures
    2022-09-10 22:40:02下载
    积分:1
  • c# socket tool
    c# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket toolc# socket tool
    2022-01-24 12:41:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载