文件名称:Gluttonous-Snake-by-CPP-and-Opencv
介绍说明--下载内容均来自于网络,请自行研究使用
用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