Project On Computr Graphics: Submitted By
Project On Computr Graphics: Submitted By
ACKNOWLEDGEMENT
I would like to express my gratitude to all those who have helped me in the successful completion of my project. I want to thank the Department of CSE of Lovely Professional University for giving me permission to commence on this project. I would like to thank MR. ROHITT SHARMA for helping me somehow and encouraged me to go ahead with my project. Especially, I would like to give my special thanks to my Class Teacher whose enabled me to complete this work.
INTODUCTION
Aim:- Program to make floating bubbles in the water.
In this program what we did that we have used several types of manual and built-in functions to Achieve appropriate,precise Output.the main function is Graphic functions to get the the crucial,surge effects. our intention is to make a screensaver of floating bubbles without overlap feature. we used various types of header file to get the rad functionality and to get the prominent result. There are some buillt-in functions that we did use and the functions and the libraries are listed below:-
1) Ellipse function. 2) Delay function 3) fill Ellipse function 4) clear Device function 5) Graphics Functions 6) kbhit(); 7)initgraph // to clear the current screen // to get the spectacular graphic effects // for keystrokes based on pressed keys //to set foreground and background color // For Timing Purporse
CODE
#include<conio.h> #include<stdio.h> #include<dos.h> #include<graphics.h> #include<stdlib.h> void Bubble_fir(int,int); void Bubble_y(int,int); void Play_sound() { sound(700); delay(100); nosound(); } void Bubble_y(int randval_x,int randval_y) { fillellipse(randval_x,randval_y,20,20); } main() { int i,j=1,val_x=1,val_y=1,count_x= 1,randval_x, randval_y,dx,dy; int gd=DETECT, gm; clrscr(); randomize(); initgraph(&gd, &gm , "c://turboc3\\bgi"); dx = 610; dy = 455; setbkcolor(4); //Set Background Color while(!kbhit()) { printf("."); if(count_x <= dx) { putpixel(count_x,100,WHITE); setfillstyle(8, CYAN); /* set the fill style */ Bubble_fir(count_x,200); Bubble_y(100,count_x); Bubble_y(500,count_x); Bubble_y(count_x,350); delay(8); count_x++; cleardevice(); } if(count_x == dx)
{ do {
Play_sound();
setfillstyle(8, YELLOW); /* set the fill style */ Bubble_fir(--count_x,200); Bubble_y(--count_x,350); Bubble_y(100,--count_x); Bubble_y(500,--count_x); delay(8); cleardevice(); } while(count_x >0); } } getch(); closegraph(); return 0; } void Bubble_fir(int randval_x,int randval_y) { fillellipse(randval_x,randval_y,20,20); }