//Ball Rolling //Written by: Aaron Hillebert //Date: 12/3/07 //Period: 3 #include #include #include #include #include #include #include #include #include #include #include #include #include int x; //Variable to make it move void ball_rolling() { int driver=VGA;// int mode=VGAHI; initgraph(&driver, &mode,"\\TC\\BGI"); //open graphics mode for (x=50;x<=450;x=x+5) { setcolor(YELLOW); //sets the color to yellow circle (x, 200, 50); //draws the circle delay(50); //a short delay to give effect of rolling setcolor(BLACK); //sets the color to black circle (x, 200, 50); //draws another circle over the orginal except in black } //repeats the loop getch(); //wait for user to press enter closegraph(); //closes graphics mode } void main() //main funtion { clrscr(); cout.setf(ios::showpoint); cout.setf(ios::fixed); ball_rolling(); //funtion that rolls the ball getch(); }