采用二维数组进行编写
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
int high=15,width=20,collide,score;
int ball_x,ball_y,right,left,radius;
int coin_x,ball_vx,ball_vy;
int canvas[15][20],board_x,board_y;
void hidecursor(){
//隐藏光标
CONSOLE_CURSOR_INFO cursor_info={
1,0};//第二个值为0表示隐藏光标
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
}
void gotoxy(int x,int y){
//将光标移到(x,y)位置
HANDLE handle=GetStdHandle(STD_OUTPUT_HANDLE);
COORD pos;
pos.X=x;
pos.Y=y;
SetConsoleCursorPosition(handle,pos);
}
void startup(){
hidecursor();
ball_x=high/2;ball_y=width/3;ball_vx