#include<stdio.h>
#include<stdlib.h>
#include<graphics.h>
#include<math.h>
#include<conio.h>
void end_1();
void final(int,int);
void game_over();
void score(int);
/* X & Y */
typedef struct xy
{
int x,y;
}xy;
int delay_n;
main()
{
int a,size;
/*ALL X & Y*/
xy A={100,200};
xy bird_l_u={480,340};
xy block_l_u={480,340};
xy fire_l_u={480,340};
xy apple_l_u={480,340};
xy dump_l,dump_r;
/*ALL PTR*/
void *bear_1;
void *bear_2;
void *bear;
void *block;
void *long_block;
void *short_block;
void *road;
void *road_1;
void *road_2;
void *road_3;
void *road_4;
void *bird;
void *fire;
void *dump;
void *apple;
void *blue;
void *round;
int grass;
/*+++++++++++++++ALL IN GAME START+++++++++++++++++*/
int bear_x=0;
int abc=0;
int in_screen=1;
int have_bird=0;
int have_fire=0;
int have_block=0;
int have_apple=0;
int have_dump=0;
int have_jump=301;
int now_jump=300;
int eat_apple=0;
int apple_color;
int round_color;
int down;
int high;
int up=0;
int xyz=77;
int right=0;
int quit;
int n=0;
int road_x=0;
int kg;
int kg_2=0;
int blood=100;
int life=3;
int cpu,cpu_y=110;
int cx,cy,ci,cj=200;
int clear_logo;
int begin,b_m=0;
char t[10];
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"c:\\tc"); /*graph*/
setbkcolor(LIGHTBLUE);
/*GET PTR>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*bear*/
/*1*/
clearviewport();
setfillstyle(1,BROWN);
setcolor(BROWN);
pieslice(22,22,0,360,10);
pieslice(30,30,0,360,10);
pieslice(29,30,0,360,15);
pieslice(30,50,0,360,10);
setfillstyle(1,DARKGRAY);
setcolor(DARKGRAY);
pieslice(40,30,0,360,8);
sector(33,30,0,360,10,14);
setfillstyle(1,BROWN);
setcolor(BROWN);
pieslice(45,30,0,360,3);
setfillstyle(1,WHITE);
setcolor(BLUE);
sector(33,22,0,360,2,4);
setfillstyle(1,YELLOW);
setcolor(YELLOW);
bar(15,45,30,50);
bar(40,45,45,50);
bar(25,55,35,60);
bar(20,60,25,65); bar(35,60,40,65);
setfillstyle(1,WHITE);
setcolor(YELLOW);
pieslice(14,48,0,360,3); pieslice(47,48,0,360,3);
sector(16,68,0,360,5,2); sector(45,68,0,360,5,2);
size=imagesize(10,10,50,70);
bear_1=malloc(size);
getimage(10,10,50,70,bear_1);
/*2*/
clearviewport();
setfillstyle(1,BROWN);
setcolor(BROWN);
pieslice(22,22,0,360,10);
pieslice(30,30,0,360,10);
pieslice(29,30,0,360,15);
pieslice(30,50,0,360,10);
setfillstyle(1,DARKGRAY);
setcolor(DARKGRAY);
pieslice(40,30,0,360,8);
sector(33,30,0,360,10,14);
setfillstyle(1,BROWN);
setcolor(BROWN);
pieslice(45,30,0,360,3);
setfillstyle(1,WHITE);
setcolor(BLUE);
sector(33,22,0,360,2,4);
setfillstyle(1,YELLOW);
setcolor(YELLOW);
bar(28,45,33,55);
bar(25,55,35,60);
bar(25,60,35,65);
setfillstyle(1,WHITE);
setcolor(YELLOW);
pieslice(30,58,0,360,3);
sector(30,68,0,360,5,2);
size=imagesize(10,10,50,70);
bear_2=malloc(size);
getimage(10,10,50,70,bear_2);
/*a block*/
clearviewport();
setfillstyle(6,GREEN);
bar(100,20,120,60);
setfillstyle(4,GREEN);
bar(120,20,140,60);
size=imagesize(100,20,140,60);
block=malloc(size);
getimage(100,20,140,60,block);
/*get long*/
clearviewport();
for(a=0;a<=11;a++)
{
putimage(40*a,20,block,COPY_PUT);
}
size=imagesize(0,20,480,60);
long_block=malloc(size);
getimage(0,20,480,60,long_block);
/*get short*/
size=imagesize(0,20,200,60);
short_block=malloc(size);
getimage(0,20,200,60,short_block);
/*get road*/
clearviewport();
setfillstyle(1,GREEN);
setcolor(GREEN);
for(grass=0;grass<=480;grass=grass+40)
{line(0+grass,80,5+grass,90);
line(0+grass,80,15+grass,85);
line(15+grass,85,20+grass,80);
line(20+grass,80,25+grass,85);
line(25+grass,85,40+grass,80);
line(40+grass,80,35+grass,90);
line(5+grass,90,35+grass,90);
floodfill(20+grass,85,GREEN); }
/*1*/
road_1=malloc(3000);
getimage(0,80,480,90,road_1);
/*2*/
road_2=malloc(3000);
getimage(10,80,490,90,road_2);
/*3*/
road_3=malloc(3000);
getimage(20,80,500,90,road_3);
/*4*/
road_4=malloc(3000);
getimage(30,80,510,90,road_4);
/*bird*/
clearviewport();
setfillstyle(1,YELLOW);
setcolor(YELLOW);
pieslice(240,170,0,360,7);
sector(260,170,0,360,20,5);
setfillstyle(2,YELLOW);
sector(260,170,60,300,15,20);
setfillstyle(8,YELLOW);
bar(228,168,233,175);
setfillstyle(1,CYAN);
pieslice(240,170,0,360,3);
size=imagesize(230,140,280,200);
bird=malloc(size);
getimage(230,140,280,200,bird);
/*fire ball*/
clearviewport();
setfillstyle(1,RED);
setcolor(RED);
pieslice(240,170,0,360,20);
setfillstyle(1,LIGHTBLUE);
setcolor(LIGHTBLUE);
pieslice(240,170,150,-150,20);
setfillstyle(1,WHITE);
pieslice(235,160,0,360,3);
size=imagesize(220,150,260,190);
fire=malloc(size);
getimage(220,150,260,190,fire);
/*dump*/
clearviewport();
size=imagesize(200,150,280,200);
dump=malloc(size);
getimage(200,150,280,200,dump);
/*apple*/
clearviewport();
setfillstyle(1,RED);
setcolor(RED);
pieslice(240,100,0,360,10);
setfillstyle(1,LIGHTGREEN);
setcolor(LIGHTGREEN);
sector(240,92,0,360,10,3);
size=imagesize(230,90,250,110);
apple=malloc(size);
getimage(230,90,250,110,apple);
/*blue*/
clearviewport();
size=imagesize(0,0,40,40);
blue=malloc(size);
getimage(0,0,40,40,blue);
clearviewport();
/*ALL PTR HAVE GET>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
setbkcolor(BLACK);
setcolor(WHITE);
settextstyle(0,0,1);
outtextxy(180,110,"->");
do{
outtextxy(180,100,"Please choice your CPU size.");
outtextxy(200,110,"Intel 80386");
outtextxy(200,120,"Intel 80486");
outtextxy(200,130,"Intel 80586");
outtextxy(200,140,"Intel Pentium 1 or newer");
outtextxy(200,150,"Intel Pentium 2 or newer");
outtextxy(200,160,"Intel Pentium 3 or newer");
outtextxy(200,170,"Intel Pentium 4 or newer");
outtextxy(200,180,"All AMD");
outtextxy(200,190,"Others");
cpu=getch();
if((cpu==72)&&(cpu_y>=120))
{
clearviewport();
cpu_y=cpu_y-10;
outtextxy(180,cpu_y,"->");
}
if((cpu==80)&&(cpu_y<=180))
{
clearviewport();
cpu_y=cpu_y+10;
outtextxy(180,cpu_y,"->");
}
if((cpu_y>=110)&&(cpu_y<=130)) delay_n=1;/*,,,,,,,,*/
if((cpu_y>=140)&&(cpu_y<=160)) delay_n=10;/*,,,,,,,,*/
if(cpu_y==170) delay_n=100;/*,,,,,,,,,,,,,,,,,,,,,,,,*/
if(cpu_y>=180) delay_n=20;/*,,,,,,,,,,,,,,,,,,,,,,,,*/
}while(cpu!=13);
settextstyle(0,0,1);
for(ci=0;ci<=180;ci=ci+1)
{
clearviewport();
cx =cj*sin(ci*0.1);
cy =cj*cos(ci*0.1);
cj=cj-1;
outtextxy(260+cx,240+cy,"Yan Yi 2004.5");
delay(50*delay_n);
}
delay(1000000000*delay_n);
/* start*/
setfillstyle(1,LIGHTBLUE);
setcolor(LIGHTBLUE);
for(clear_logo=0;clear_logo<=8000;clear_logo++)
{
pieslice(rand()%680,rand()%480,0,360,10);
}
jump: setviewport(80,70,560,410,1);
setbkcolor(LIGHTBLUE); clearviewport();
putimage(0,260,road_1,COPY_PUT);
putimage(100,200,bear_1,COPY_PUT);
putimage(200,130,short_block,COPY_PUT);
putimage(370,70,bird,COPY_PUT);
putimage(150,110,apple,COPY_PUT);
putimage(400,220,fire,COPY_PUT);
putimage(0,270,long_block,COPY_PUT);
setcolor(BLUE);
settextstyle(0,0,3);
outtextxy(170,130,"Start");
outtextxy(170,180,"Mission");
do{
begin=getch();
if((begin==80)||(begin==72)){
setcolor(WHITE);
if(b_m%2==0)
{
outtextxy(170,180,"Mission");
setcolor(BLUE);outtextxy(170,130,"Start");setcolor(WHITE);
}
if(b_m%2!=0)
{
outtextxy(170,130,"Start");
setcolor(BLUE);outtextxy(170,180,"Mission");setcolor(WHITE);
}
Bear_Go_Homw.rar_Bear_Go_Homw_Go_ Go_ Go!
版权申诉
153 浏览量
2022-09-20
14:00:34
上传
评论
收藏 5KB RAR 举报
JonSco
- 粉丝: 75
- 资源: 1万+
最新资源
- nginx配置文件,注意其中需要对应宿主机的路径
- 自用数据集自用数据集自用数据集
- HTML5小游戏【堆雪人-优秀H5小游戏合集】游戏源码分享下载 - epicsnowman.zip
- SNMP Client 是SNMP测试工具
- Android Camera内存统计脚本
- AD9220高速数据芯片硬件参考设计原理图+STM32F103单片机驱动程序代码+芯片技术手册资料.zip
- 常用爆破用户名字典top500
- meta-llama-3-8b-instruct 的 model-00003-of-00004.safetensors 的2/3
- bootstrap-select.js bootstrap-select.css
- EasyPoi Excel和 Word简易工具类
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈