C++小游戏

C++小游戏

C++能做许多好玩的小游戏,我做了一个“贪吃球”(类似贪吃蛇)

后面加了一堆system(“pause”)为了编程exe后有多级缓冲

#include <bits/stdc++.h>
#include <conio.h>
using namespace std;
int plane[10][20];
int x = 0;
int y = 0;
int xr;
int yr;
int maxtime = 5;
//int recordx[99999999][2];
void clear()
{
   
	for(int i = 0; i < 10; i++)
	{
   
		for(int j = 0; j < 20; j++)
		{
   
			plane[i][j] = -1;
		}
	}
}
void welcome()
{
   
	cout << "Welcome to my game" << endl;
	cout << "By Wallace" << endl;
	cout << "贪吃球v1.1" << endl;
	cout << "游戏规则:通过WASD移动@图标(小球)去吃#(食物),若在规定时间内无法吃到食物则游戏结束!" << endl;
    cout << "注意换掉中文输入法,或按下CAPSLOCK"  << endl;
    cout << endl << "请选择难度(默认为:普通):" << endl << "1、简单(8秒)" << endl << "2、普通(5秒)" << endl << "3、困难(4秒)" <<endl <<  "4、魔鬼(3秒)" << endl << "5、地狱(2秒)" << endl;
	cout << "*魔鬼模式与地狱模式几乎不可能,新手请从简单模式开始" << endl;
    cout << "请输入:";
    int n;
    cin >> n;
    if(
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值