赛车游戏DEVC++

#include
#include
#include 
#include  
#include
#include    
#include   
#include    
#include     
using namespace std;
int dx,dy;
int mx,my;
int sea[5][3];
int ms=0;
int maxms=0;
int healthy=1;
/*
000
000
080
*/
int x_what(int x) {//取随机数
	srand((unsigned)time(NULL));
	return( rand() % x);
}
int first(){
	char ch;
	for(int i=0;i<3;i++){
		for(int j=0;j<3;j++){
			sea[i][j]=0;
		}
	}
	sea[4][1]=8;
	mx=4;
	my=1;
	cout<<"++++"<0){
				my--;
			}
		}
		if(ch=='d'){
			if(my<2){
				my++;
			}
		}
	}
}
int s(){
	if(dx==4){
		dx=0;
		dy=x_what(3);
	}
	else{
		dx++;
	}
}
int main(){
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);
	first();
	ms=0;
	while(healthy>0){
		out();
		play();
		s();
		Sleep(500);
		system("cls");
		ms+=50;
		if(dy==my&&dx==mx){
			healthy--;
		}
	}
	system("cls");
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED	); 
	cout<

你可能感兴趣的:(c++)