- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <windows.h>
- int main()
- {
- int plane_x,plane_y;
- int enemy_x,enemy_y;
- int zidan_x,zidan_y;
- int bottom,right;
- int x,y,a,b;
- char zifu;
- void startup()//初始化
- {
- plane_x=10;
- plane_y=10;
- right=80;
- bottom=40;
- }
- while(666)//游戏循环
- {
- void show()//显示画面
- {
- system("cls");
- for(b=0;b<=bottom;b++)
- {
- for(a=0;a<=right;a++)
- {
- if((a==plane_x)&&(b==plane_y))
- printf("A");
- else
- printf(" ");
- }
- printf("");
- Sleep(100);
- system("pause");
- }
- }
- void updatewithoutinput()
- {
-
- }
- void updatewithinput()
- {
- zifu=getch();
- if(zifu=='w'&&plane_y>0)
- plane_y--;
- }
- }
- system("pause");
- return 0;
- }
复制代码 |