初代小恐龙(空格或w跳跃,s下蹲)

#include <iostream>
#include <cstring>
#include <cstdlib> 
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <Windows.h>
using namespace std;
string a[9][8]={   "                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                    #                                     "
			      ,"____________________________________#_____________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                    #                                     "
			      ,"                                    #                                     "
			      ,"                                    #                                     "
			      ,"____________________________________#_____________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                   ##                                     "
			      ,"___________________________________##_____________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                   ##                                     "
			      ,"                                   ##                                     "
			      ,"                                   ##                                     "
			      ,"___________________________________##_____________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                  ###                                     "
			      ,"__________________________________###_____________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                  ###                                     "
			      ,"                                  ###                                     "
			      ,"                                  ###                                     "
			      ,"__________________________________###_____________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"__________________________________<o{_____________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                  <o{                                     "
			      ,"                                                                          "
			      ,"__________________________________________________________________________"
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                  <o{                                     "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"                                                                          "
			      ,"__________________________________________________________________________"};
int hit=0,hit1=0,cnt=0,cntt=0;
double cntx=0,cntsu_du=15;
int x[3]={0,0,0},y[3]={7,6,5};
void input()
{
    if(_kbhit())
	{
        switch(_getch())
		{
            case ' ':
            	hit=1,cnt=12;
            case 'w':
            	hit=1,cnt=12;
            case 's':
            	hit1=1,x[2]=x[1]+1,y[2]=y[1],cntt=2;
        }
    }
    if(hit1==0||hit==1)
    	x[2]=x[1],y[2]=y[1]-1;
}
int chang=37,ch=34;
int main(){
	srand((unsigned int)time(NULL));
	int rand1=rand()%9;
	for(int i=0;i<ch;i++){
		for(int i1=0;i1<9;i1++){
			for(int j1=0;j1<=i;j1++){
				if(i1==y[0]&&j1==x[0])
					cout<<'*';
				if(i1==y[1]&&j1==x[1])
					cout<<'#';
				if(i1==y[2]&&j1==x[2])
					cout<<'o';
				if(!(i1==y[2]&&j1==x[2])&&!(i1==y[1]&&j1==x[1])&&!(i1==y[0]&&j1==x[0]))
					cout<<a[rand1][i1][j1];
			}
			cout<<"\n";
		}
		Sleep(1);
		system("cls"); 
	}
	int over=0;
	while(over==0){
		system("cls");
		if(hit!=1)
			input();
		if(cnt==0)
			hit=0;
		if(cntt>0)
			cntt--;
		if(cntt==0)
			hit1=0;
		for(int i=0;i<3;i++){
			x[i]++;
		}
		if(hit==1){
			if(cnt>9){
				if(cnt==12||cnt==11)
					for(int i=0;i<3;i++){
						y[i]-=2;
					}
				else
					for(int i=0;i<3;i++){
						y[i]-=1;
					}
				cnt--;
			}
			else if(cnt<=3){
				if(cnt==3)
					for(int i=0;i<3;i++){
						y[i]+=1;
					}
				else
					for(int i=0;i<3;i++){
						y[i]+=2;
					}
				cnt--;
			}
			else
				cnt--;
		}
		if(x[0]==chang){
			rand1=rand()%9;
			for(int i=0;i<3;i++){
				x[i]=0;
			}
		}
		for(int i=0;i<3;i++){
			if(a[rand1][y[i]][x[i]]!=' '&&a[rand1][y[i]][x[i]]!='_')
				over=1;
		}
		cout<<"                                  分数:";
		int cntx1=cntx;
		printf("%07d\n",cntx1); 
		for(int i=0;i<8;i++){
			for(int j=x[0];j<x[0]+ch;j++){
				if(i==y[0]&&j==x[0])
					cout<<'*';
				if(i==y[1]&&j==x[1])
					cout<<'#';
				if(i==y[2]&&j==x[2])
					cout<<'o';
				if(!(i==y[2]&&j==x[2])&&!(i==y[1]&&j==x[1])&&!(i==y[0]&&j==x[0]))
					cout<<a[rand1][i][j];
			}
			cout<<"\n";
		}
		cntx+=0.5;
		if(cntx1%100==0)
			cntsu_du-=0.5;
		Sleep(cntsu_du);
	}
	return 0;
}
36 个赞

先赞后看
养成习惯

8 个赞

力推 :heart:

7 个赞

大佬辛苦了

3 个赞

好玩,赞了

3 个赞

厉害,就是玩起来有点费眼睛

3 个赞

厉害

5 个赞

先赞后看!
养成好习惯!

2 个赞

已赞 :+1:

2 个赞

下蹲等于没有啊一帧就站起来了

2 个赞

第二代就修复

3 个赞

2 个赞

8:00点就发第二代

3 个赞

挺好的

3 个赞

小恐龙第二代已经发了,搜“小恐龙第二代”就可搜到小恐龙的最新版本

2 个赞

直接传送看2.0吧家人们,小恐龙第二代出了,w或空格跳,s蹲下(只要点一下就可以蹲一段距离,长按就可以长蹲),这次还加了神秘障碍

1 个赞

太牛了大佬

1 个赞