-
更改运行程序的鼠标指示的形状,一个非常实用的程序代码....
更改运行程序的鼠标指示的形状,一个非常实用的程序代码.-Run the program to change the shape of mouse instructions, a very practical program code.
- 2022-01-31 05:46:08下载
- 积分:1
-
给代码暂停把他防止瞬时检测调试器调试器…
Give the code pause to attach him to debuger to prevent detecting debuger instance
- 2022-03-06 22:53:29下载
- 积分:1
-
模拟指示灯控件。
模拟指示灯控件。-simulated light controls.
- 2022-01-31 06:53:05下载
- 积分:1
-
完整的漂亮的政府府网站asp编码完整的漂亮的政府府网站asp编码
完整的漂亮的政府府网站asp编码完整的漂亮的政府府网站asp编码-Integrity of the Government House website beautiful asp coding integrity of the Government House website beautiful asp coding
- 2022-05-26 19:51:55下载
- 积分:1
-
on API intercept packets principle HOOK
关于API HOOK拦截封包原理-on API intercept packets principle HOOK
- 2022-05-05 07:19:41下载
- 积分:1
-
vb.net做的动态编译并即时执行代码的程序。充分利用了.net的功能,让您的程序可以有更好的互动性。...
vb.net做的动态编译并即时执行代码的程序。充分利用了.net的功能,让您的程序可以有更好的互动性。-vb.net so dynamic and immediate implementation of compiler code procedures. The full use of. Net capabilities, allowing your program can have a better interactive.
- 2023-06-15 01:40:03下载
- 积分:1
-
on Mandelbrot Set and Julia Set an application.
这是关于Julia集 与 Mandelbrot集的一个应用程序。-on Mandelbrot Set and Julia Set an application.
- 2022-01-28 07:10:12下载
- 积分:1
-
USB interface can be used to test whether, if an error occurs, display error cau...
测试USB接口是否能用,若出现错误,则显示出错原因,推荐解决方法-USB interface can be used to test whether, if an error occurs, display error causes, recommend solutions
- 2022-06-20 15:37:00下载
- 积分:1
-
a small VB Management System
一个小小的VB管理系统-a small VB Management System
- 2022-12-27 15:15:03下载
- 积分:1
-
迷宫追寻小游戏 C++MFC
应用背景
这个游戏为玩家控制红色方块,去吃掉棕色,绿色,蓝色的方块,一旦一个方块被吃,便会自动生成另一个相同颜色的方块。直到游戏时间结束为止。
程序函数功能:
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函数:
完成时间的计算。
关键技术游戏中的人工智能:
棕色方块的移动算法为基本寻路算法—物体沿着墙走。
绿色方块的移动算法为基本的逃避算法—物体总会向玩家的反方向移动。
蓝色方块的移动算法为漫游算法—随机产生一个方向值,物体移动的方向不
- 2022-03-23 18:25:51下载
- 积分:1