怎么让c语言的圆自动往上方移动呢?
#include <stdio.h>#include <stdlib.h>
#include <graphics.h>
#include <conio.h>
int main(void)
{
char directKey;
int x=450, y =300, radius =50;
initwindow(900 , 600);
setcolor(YELLOW);
outtextxy(10, 10, "=============圓形移動程式=============");
outtextxy(10, 30, "按數字鍵8開始移動");
circle(x, y, radius);
while(directKey!=17)
{
directKey=getch();
clearviewport();
witch(directKey)
{
case 56:
y-=5;
break;
}
circle(x, y, radius);
}
return 0;
}
如题,这个是手动按8让圆往上移动,那怎么能让他自动往上呢?