文件名称:Gluttonous-Snake-by-CPP-and-Opencv
-
所属分类:
- 标签属性:
- 上传时间:2016-08-02
-
文件大小:2.35kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
用C++和Opencv实现了一下贪吃蛇游戏
设计思路:
1.显示初始画面,蛇头box初始位置为中心,食物box位置随机
2.按随机方向移动蛇头,按a、s、d、w键控制移动方向,分别为向左,向下,向右,向上
3.蛇头位置与食物box位置重合,则把食物box加入到蛇身向量arraryBox里,并设置食物box为第一个元素
4.蛇身各个box移动规律是,每次移动后一个box的位置变为前一个box的位置
5.蛇头移动超越边界,游戏结束-With Opencv and C++ to achieve a snake game
Design ideas:
1 shows the initial screen, box head initial position as the center, food box random position
2 according to the random direction snakeheads, according to a, s, D, w keys to control the direction of movement, respectively, to the left, down, right, up
3. Snake head position and food box positions coincide, the food box to join the snake vector arraryBox, and set the food box for the first element
4 snake movement is box, a box position after each move into position before a box
5 head moving beyond the boundary, the end of the game
设计思路:
1.显示初始画面,蛇头box初始位置为中心,食物box位置随机
2.按随机方向移动蛇头,按a、s、d、w键控制移动方向,分别为向左,向下,向右,向上
3.蛇头位置与食物box位置重合,则把食物box加入到蛇身向量arraryBox里,并设置食物box为第一个元素
4.蛇身各个box移动规律是,每次移动后一个box的位置变为前一个box的位置
5.蛇头移动超越边界,游戏结束-With Opencv and C++ to achieve a snake game
Design ideas:
1 shows the initial screen, box head initial position as the center, food box random position
2 according to the random direction snakeheads, according to a, s, D, w keys to control the direction of movement, respectively, to the left, down, right, up
3. Snake head position and food box positions coincide, the food box to join the snake vector arraryBox, and set the food box for the first element
4 snake movement is box, a box position after each move into position before a box
5 head moving beyond the boundary, the end of the game
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Gluttonous Snake.cpp
Please Read me Fisrt!.txt
Please Read me Fisrt!.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.