Friends this is a simple CG program for creating a bouncing ball
I am on windows 7 and using a doxbox emulator for full screen.
I am getting 85 % grey color and rest black color with bouncing ball as out put but as you can see below I haven't used any color element so Why am I getting the grey color ???
Is is just the emulator or any problem in code :annoyed:
Please help !!!
I am on windows 7 and using a doxbox emulator for full screen.
I am getting 85 % grey color and rest black color with bouncing ball as out put but as you can see below I haven't used any color element so Why am I getting the grey color ???
Is is just the emulator or any problem in code :annoyed:
Please help !!!
Code:
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
//#include<stdlib.h>
//#include<stdio.h>
#include<math.h>
void main ()
{
int gd,gm,r,x,y;
float ym;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"c:\\tc\\bgi");
x=300;
y=200;
r=50;
ym=400;
while(!kbhit())
{
if(y<=ym)
{
clrscr();
y=y+20;
circle(x,y,r);
delay(100);
}
else
{
do
{
clrscr();
y=y-20;
circle(x,y,r);
delay(100);
}
while(y!=0);
}
}
getch();
}