資源簡介
彈球小游戲
代碼片段和文件信息
#include
#include
#include
#include
//全局變量?
int?highwidth;?????????????//游戲畫面位置?
int?ball_xball_y;??????????//小球的坐標(biāo)?
int?ball_vxball_vy;????????//小球的速度?
int?position_xposition_y;??//擋板的中心坐標(biāo)?
int?ridus;??????????????????//擋板的半徑大小?
int?leftright;?????????????//擋板的左右位置
int?ball_number;????????????//反彈小球的次數(shù)?
int?block_xblock_y;????????//磚塊的位置?
int?score;??????????????????//消掉磚塊的個數(shù)?
void?gotoxy(int?xint?y)????//將光標(biāo)移動到(x,y)位置?
{
HANDLE?handle=GetStdHandle(STD_OUTPUT_HANDLE);
COORD?pos;
pos.X=x;
pos.Y=y;
SetConsoleCursorPosition(handlepos);
}
void?HideCursor()??//隱藏光標(biāo)顯示
{
????CONSOLE_CURSOR_INFO?cursor_info?=?{?1?0?};
????SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE)?&cursor_info);
}
void?startup()????
評論
共有 條評論