Posts

Showing posts with the label Looping Animation

Bouncing Ball Program in C Using Graphics (C Graphics में Bouncing Ball प्रोग्राम)

A bouncing ball is a simple computer graphics animation in which a ball moves horizontally and bounces up and down. The animation repeats continuously using a loop. Bouncing Ball एक सरल Computer Graphics Animation है, जिसमें एक गेंद स्क्रीन पर आगे बढ़ते हुए ऊपर-नीचे उछलती है। Loop की सहायता से यह Animation लगातार Repeat होता रहता है। C Program #include <stdio.h> #include <conio.h> #include <graphics.h> #include <dos.h> int main() { int gd = DETECT, gm = 0; int x, y, direction; initgraph(&gd, &gm, ""); setcolor(RED); setfillstyle(SOLID_FILL, RED); while (!kbhit()) { x = 40; y = 100; direction = 1; while (x < 602) { cleardevice(); circle(x, y, 30); floodfill(x, y, RED); delay(40); x += 5; y += direction * 10; if (y >= 400) { y = 400; direction = -1...