drawFrame(0, 0, 48, 24, '=', '|');// draw map frame; drawFrame(49, 0, 79, 4, '-', '|');// drawFrame(49, 4, 79, 9, '-', '|');//
draw output frame draw score frame
drawFrame(49, 9, 79, 20, '-', '|');// draw operate frame
drawFrame(49, 20, 79, 24, '-', '|');// draw frame SetPos(52, 6); cout<<\得分:\ SetPos(52, 7); cout<<\称号:\ SetPos(52,10); cout<<\操作方式:\ SetPos(52,12);
cout<<\ a,s,d,w 控制战机移动。\ SetPos(52,14);
cout<<\ p 暂停游戏。\ SetPos(52,16);
cout<<\ e 退出游戏。\
}
//在[a, b)之间产生一个随机整数 int random(int a, int b) other message
{ }
//在两个坐标包括的矩形框内随机产生一个坐标 COORD random(COORD a, COORD b) { }
bool judgeCoordInFrame(Frame frame, COORD spot) {
if(spot.X>=frame.position[0].X)
if(spot.X<=frame.position[1].X)
if(spot.Y>=frame.position[0].Y)
if(spot.Y<=frame.position[0].Y)
return true;
int x=random(a.X, b.X); int y=random(a.Y, b.Y); COORD c={x, y}; return c;
int c=(rand() % (a-b))+ a; return c;
return false;
}
void printCoord(COORD a) { }
void printFrameCoord(Frame a) { }
int drawMenu() {
SetPos(30, 1);
cout<<\ W a r\drawRow(3, 0, 79, '-'); drawRow(5, 0, 79, '-'); SetPos(28, 4);
cout<<\和 s 选择, k 确定\printCoord(a.position[0]); cout <<\
printCoord(a.position[1]);
cout <<\
SetPos(15, 11);
cout<<\简单的敌人\SetPos(15, 13);
cout<<\冷酷的敌人\drawRow(20, 0, 79, '-'); drawRow(22, 0, 79, '-'); SetPos(47, 11); cout<<\简单的敌人:\SetPos(51, 13);
cout<<\简单敌人有着较慢的移动速度。\SetPos(24, 21);
cout<<\制作: 中北大学 12060341 梦笔西谈\int j=11; SetPos(12, j); cout<<\
//drawFrame(45, 9, 79, 17, '=', '|');
while(1) { if( _kbhit() ) {
char x=_getch();
switch (x) { case 'w' : {
\
}
case 's' :
if( j == 13) { SetPos(12, j); cout<<\ \ j = 11; SetPos(12, j); cout<<\ SetPos(51, 13);
cout<<\ \ SetPos(47, 11); cout<<\简单的敌人:\ SetPos(51, 13);
cout<<\简单敌人有着较慢的移动速度。
} break;