文件名称:Snake
-
所属分类:
- 标签属性:
- 上传时间:2012-12-25
-
文件大小:72.08kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
蛇的活动区是由57×33个小方格组成,当这些小方格呈现深灰色时,便表示蛇身。蛇是由n个相邻的方格组成,将这些方格的坐标依蛇头到蛇尾的次序放入到一个数组中便代表了蛇身。当蛇在活动区中游动一格时,所对应的的数组操作为,将新的位置坐标插入到数组的头部,同时将数组中最后一个元素删除。
游戏使用四个方向键和A/W/S/D来控制蛇的前进方向,在OnKeyDown()消息处理函数中,根据不同的方向键设置了成员变量m_nDirect的值。当在菜单中选择开始时,启动定时器,游戏开始。在定时器消息处理函数中,根据m_nDirect的值判断出蛇的下一个位置。如果没有超出边界或碰到自身,则蛇可以移动到一个新位置。如果吃到了食物,则在CArray()中只插入而不删除最后一个元素,蛇身长度增加,否则弹出游戏结束对话框,框内显示所用时间和最终得分。
菜单栏的项目以实用性为主,另外每个按钮都设置有快捷键,分别为:F1-帮助;F2-开始游戏;F4-关闭窗口,退出游戏
-The snake s activity area is composed by 57 × 33 small squares, when these small squares presented a dark gray, and they said the snake. Snake n adjacent squares, the grid coordinates to the tail of the order in accordance with snakeheads into it on behalf of the snake into an array. Snake swimming in the activity area grid array operation corresponding to the new location coordinates inserted into the head of the array, while the last element in the array to delete.
The game uses the four arrow keys and A/W/the S/D to control the forward direction of the snake, OnKeyDown () message processing function, depending on the direction of the key to set the value of the member variables m_nDirect. When in the menu, select Start to start the timer, the start of the game. In the the timer message processing function, based on the value of m_nDirect determine the next position of the snake. If there is no out of bounds or encounter itself, the snake can move to a new location. If you eat the f
游戏使用四个方向键和A/W/S/D来控制蛇的前进方向,在OnKeyDown()消息处理函数中,根据不同的方向键设置了成员变量m_nDirect的值。当在菜单中选择开始时,启动定时器,游戏开始。在定时器消息处理函数中,根据m_nDirect的值判断出蛇的下一个位置。如果没有超出边界或碰到自身,则蛇可以移动到一个新位置。如果吃到了食物,则在CArray()中只插入而不删除最后一个元素,蛇身长度增加,否则弹出游戏结束对话框,框内显示所用时间和最终得分。
菜单栏的项目以实用性为主,另外每个按钮都设置有快捷键,分别为:F1-帮助;F2-开始游戏;F4-关闭窗口,退出游戏
-The snake s activity area is composed by 57 × 33 small squares, when these small squares presented a dark gray, and they said the snake. Snake n adjacent squares, the grid coordinates to the tail of the order in accordance with snakeheads into it on behalf of the snake into an array. Snake swimming in the activity area grid array operation corresponding to the new location coordinates inserted into the head of the array, while the last element in the array to delete.
The game uses the four arrow keys and A/W/the S/D to control the forward direction of the snake, OnKeyDown () message processing function, depending on the direction of the key to set the value of the member variables m_nDirect. When in the menu, select Start to start the timer, the start of the game. In the the timer message processing function, based on the value of m_nDirect determine the next position of the snake. If there is no out of bounds or encounter itself, the snake can move to a new location. If you eat the f
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Snake/MainFrm.cpp
Snake/MainFrm.h
Snake/ReadMe.txt
Snake/resource.h
Snake/Snake.aps
Snake/Snake.clw
Snake/Snake.cpp
Snake/Snake.dsp
Snake/Snake.dsw
Snake/Snake.h
Snake/Snake.ncb
Snake/Snake.opt
Snake/Snake.plg
Snake/Snake.rc
Snake/SnakeDoc.cpp
Snake/SnakeDoc.h
Snake/SnakeView.cpp
Snake/SnakeView.h
Snake/StdAfx.cpp
Snake/StdAfx.h
Snake/Release/MainFrm.obj
Snake/Release/Snake.exe
Snake/Release/Snake.obj
Snake/Release/Snake.res
Snake/Release/SnakeDoc.obj
Snake/Release/SnakeView.obj
Snake/Release/StdAfx.obj
Snake/Release/vc60.idb
Snake/res/Snake.ico
Snake/res/Snake.rc2
Snake/res/SnakeDoc.ico
Snake/Release
Snake/res
Snake
Snake/MainFrm.h
Snake/ReadMe.txt
Snake/resource.h
Snake/Snake.aps
Snake/Snake.clw
Snake/Snake.cpp
Snake/Snake.dsp
Snake/Snake.dsw
Snake/Snake.h
Snake/Snake.ncb
Snake/Snake.opt
Snake/Snake.plg
Snake/Snake.rc
Snake/SnakeDoc.cpp
Snake/SnakeDoc.h
Snake/SnakeView.cpp
Snake/SnakeView.h
Snake/StdAfx.cpp
Snake/StdAfx.h
Snake/Release/MainFrm.obj
Snake/Release/Snake.exe
Snake/Release/Snake.obj
Snake/Release/Snake.res
Snake/Release/SnakeDoc.obj
Snake/Release/SnakeView.obj
Snake/Release/StdAfx.obj
Snake/Release/vc60.idb
Snake/res/Snake.ico
Snake/res/Snake.rc2
Snake/res/SnakeDoc.ico
Snake/Release
Snake/res
Snake
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.