Click & Register in this...
Click & Register in this..... enjoy earning easily..
Register in this...... earn easily $$$$$$$$$$$$ Earn upto Rs. 9,000 pm checking Emails. Join now! - sunny

Tuesday, July 13, 2010

love prog. in c graphics

//Author : Srikanth Noundla
//Email ID : sicetece@gmail.com
//Web Site : sicetece.blogspot.com


//do u love any1 just use dis 2 express ur feelings n help me in new concepts

//Displays as my heart is full of u

#include
#include
#include
#include
#include
heart();
arrow_after_hit(int);

//draws heart
heart()
{
setcolor(6);
setfillstyle(SOLID_FILL,6);
pieslice(450,100,0,360,40);
pieslice(520,100,0,360,40);
pieslice(493,208,55,131,100);
return 0;
}

//draws broken arrow after hit heart
arrow_after_hit(int x)
{
settextstyle(DEFAULT_FONT,0,1);
setcolor(YELLOW);
outtextxy(x+35,110,">>>-----");
setcolor(RED);
outtextxy(x+95,110,"-");
return 0;
}

void main()
{
int gd=DETECT,gm,x,y,i,d;
char name[20];
clrscr();
initgraph(&gd,&gm,"c:\\tc\\bgi");
//intialise

outtextxy(20,20,"Hi friend");
outtextxy(20,30,"pls Enrole ur name");
printf("\n\n\n\t\t");
fflush(stdin);
//reads user name
gets(name);
//changes background color
setbkcolor(8);
//sets color of font
setcolor(6);
//sets fill style
setfillstyle(SOLID_FILL,6);
//draws heart
pieslice(450,100,0,360,40);
pieslice(520,100,0,360,40);
pieslice(493,208,55,131,100);

//motion of arrow
for(x=0;x<385;x=x+2)
{

setcolor(YELLOW);
//draws arrow
outtextxy(x-7,110,">>>---------->");
delay(30);
cleardevice();
heart();

setcolor(YELLOW);
outtextxy(x-7,110,">>>---------->");
}

heart();
arrow_after_hit(x);

//blood drops
for(i=0;i<2;i++)
{
for(y=105;y<250;y++)
{
setfillstyle(SOLID_FILL,RED);
pieslice(x+105,y,0,360,4);
if(i>0 && y>120)
{
pieslice(x+90,y,0,360,2);
delay(10);
}
if(y>150)
{
pieslice(x+105,y-15,0,360,3);
delay(10);
pieslice(x+110,y-30,0,360,4);
delay(10);
pieslice(x+95,y-5,0,360,4);
}
delay(10);
cleardevice();
heart();
arrow_after_hit(x);

//sets delay time
for(d=0;d<5;d++)
{
delay(d);
}

} if(i>0)
{
//prints user name
settextstyle(GOTHIC_FONT,0,4);
outtextxy(x+80,y-30,name);
}
}

setcolor(YELLOW);
settextstyle(SANS_SERIF_FONT,0,4);
for(d=0;d<50;d++)
{
delay(d);
}
outtextxy(100,200,"Created by");
for(d=0;d<30;d++)
{
delay(d);
}
setcolor(13);
outtextxy(102,238,"Srikanth Noundla");
setcolor(YELLOW);
outtextxy(100,240,"Srikanth Noundla");
getch();
closegraph();
}

No comments:

Post a Comment