Subscribe Our Channel

header ads

Search This Blog

Friday, September 10, 2021

HEART ANIMATIOMMN IN C++

 //...........WELCOE ALL OF YOU ON ROHIT TECH STUDY CHANNEL.................//

//....>>>>>.......C++ PROGRAM TO DRAW HEART ANIMATION...........<<<<<<.....//


#include <conio.h>

#include <math.h>

#include <dos.h>

#include <stdlib.h>

#include <graphics.h>


int main()

{

 int x,y,r,midx,midy,color;

 float t;

 int gdriver=DETECT,gmode;

 initgraph(&gdriver, &gmode, "C:\\TC\\BGI");

 midx=getmaxx()/2;

 midy=getmaxy()/2;

 r=10;

 color=12;

 setcolor(12);

 setfillstyle(1,12);

 settextstyle(0,0,3);

 do

 {

   outtextxy(midx-220,35,"I LOVE PROGRAMMING");

   outtextxy(midx-175,midy+180,"ROHIT TECH STUDY");

   for(t=0;t<(2*M_PI);t+=0.01)

   {

    x=(r*16*sin(t)*sin(t)*sin(t))+midx;

    y=(r*(1-2)*(13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)))+(midy-30);

    pieslice(x,y,0,360,5);

   }

   floodfill(midx,midy,color);

   delay(800);

   cleardevice();

   color=random(15)+1;

   setcolor(color);

   setfillstyle(1,color);

 }

 while(!kbhit());

 getch();

 closegraph();

 return 0;

}



//_________________I HOPE YOU LIKE THIS CODING____________________________//

//______________DON'T FORGET TO LIKE AND SUBSCRIBE________________________//


BOUNCING BALL GAME IN C++

 //___________WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL________________//

//_______________C++ PROGRAM TO MAKE BOUNCING BALL GAME______________________//



#include <graphics.h>

#include <stdlib.h>

#include <stdio.h>

#include <conio.h>

#include <dos.h>


int main()

{

   Play_Again:

   int gdriver = DETECT, gmode, errorcode;

   int midx,midy,maxx,maxy,ball_x,ball_y,key;

   int speed,bar_upper,bar_lower,gap,score,fail,i;

   int bar_x[3],bar_y[3],color[3],bar_i[3],pattern[3];

   float ball_vlct;

   initgraph(&gdriver,&gmode,"C:\\TC\\BGI");

   fail=0;

   speed=0;

   score=0;

   key=0;

   gap=85;

   ball_vlct=0.80;

   midx=getmaxx()/2;

   midy=getmaxy()/2;

   maxx=getmaxx();

   maxy=getmaxy();

   ball_x=25;

   ball_y=midy;

   bar_upper=5;

   bar_lower=maxy-5;

   bar_x[0]=maxx-10;

   bar_x[1]=bar_x[0]+219;

   bar_x[2]=bar_x[1]+219;

   for(i=0;i<=2;i++)

   {

     bar_y[i]=random(maxy-150);

     color[i]=random(15)+1;

     bar_i[i]=0;

     pattern[i]=random(13);

   }


   do

   {

     if(kbhit())

     {

       if((key=getch())==' '||(key=getch())==' ')

       {

ball_vlct=0.6;

speed=speed+ball_vlct-50;

       }

     }


     if(fail==1)

     {

      for(i=0;i<=2;i++)

color[i]=10;

     }


     setcolor(BLACK);

     setfillstyle(1,20);


      //draws ball

     fillellipse(ball_x,ball_y+speed,10,10);

      //draws bar with random color

     for(i=0;i<=2;i++)

     {

     setcolor(color[i]);

       //setfillstyle(pattern[i],color[i]);

   rectangle(bar_x[i]-bar_i[i],bar_y[i]+gap,bar_x[i]+25-bar_i[i],bar_lower);

   rectangle(bar_x[i]-bar_i[i],bar_y[i],bar_x[i]+25-bar_i[i],bar_upper);

   }

     if(fail==1)

     {

       delay(1000);          //exit if fail

       break;

     }


     gotoxy(1,2);

     printf("Score: %d",score);

     for(i=0;i<=2;i++)            //check for fail or not

     {

       if(bar_x[i]-bar_i[i]<=25)

       {

if(!(ball_y+speed>=bar_y[i]&&ball_y+speed<=bar_y[i]+85))

   fail=1;

else

   fail=0;

       }

     }

     //checks for ball doesn't go out of the screen

     if(ball_y+speed>maxy-20)

     {

       ball_vlct=0.0;

       speed=0;

       ball_y=maxy-27;

     }

     if(ball_y+speed<20)

     {

       speed=0;

       ball_y=25;

     }


     //increments the values

     ball_vlct=ball_vlct+0.81;

     speed=speed+ball_vlct;

     for(i=0;i<=2;i++)

       bar_i[i]=bar_i[i]+5;


     for(i=0;i<=2;i++)

     {

     //restart the bar values again

       if(bar_x[i]-bar_i[i]+25<=0)

       {

bar_i[i]=0;

bar_x[i]=maxx;

bar_y[i]=random(maxy-150);

color[i]=random(15)+1;

pattern[i]=random(13);

score++;

       }

     }

     delay(50);

     cleardevice();

   }while(1);

   closegraph();

   clrscr();


   char name[12];

   gotoxy(25,10);

   textcolor(3);

   cprintf("Enter your name:- ");

   gets(name);

   gotoxy(25,11);

   textcolor(RED);

   cputs(name);

   cprintf(" your score is %d",score);

   gotoxy(26,13);

   textcolor(RED+BLINK);

   cprintf("Play Again(y/n)");

   char play=getch();

   if(play=='y')

   {

     goto Play_Again;

   }

   return 0;

}

 //___________________PRESS SPACE KEY TO BOUNCE BALL_______________________//

//--------------------THANKS TO WATCHING THIS VIDEO------------------------//

GANPATA BAPPA MORYA C PROGRAMMING

 //_____________WELCOME ALL OF YOU ON ROHIT  TECH STUDY CHANNEL______________//

//____________________C++ PROGRAM TO DRAW LORD GANESHA_____________________//


#include<stdio.h>

#include<graphics.h>

#include<conio.h>


int main(void)

{


int gd=DETECT, gm;

initgraph(&gd,&gm,"c:\\tc\\bgi");


setcolor(15);

setlinestyle(0,0,3);

ellipse(300,100,300,100,40,50);


ellipse(290,110,310,60,40,40);


ellipse(310,95,90,270,10,20);


ellipse(320,205,180,90,50,60);


ellipse(298,145,20,180,18,10);


ellipse(300,215,180,70,20,20);


ellipse(305,175,190,270,40,20);


ellipse(300,95,90,270,10,20);


ellipse(335,140,120,180,70,30);


ellipse(298,65,290,90,5,10);


ellipse(270,115,100,240,15,30);


ellipse(275,60,240,15,15,30);


//BEAD

setcolor(RED);

setfillstyle(1,LIGHTRED);

ellipse(310,95,0,360,10,20);

floodfill(310,95,RED);


//EARS

setcolor(WHITE);

ellipse(255,155,210,60,10,10);

ellipse(214,162,30,120,55,30);

ellipse(183,157,300,90,20,20);

ellipse(190,205,90,290,10,30);

line(247,180,193,235);


//LEGS

ellipse(190,270,90,270,30,30);

ellipse(190,330,350,90,50,30);

ellipse(190,270,350,90,50,30);

ellipse(340,300,290,90,60,40);

ellipse(290,277,180,20,50,40);

line(245,160,247,180);

line(270,205,280,215);


//RECTANGLE

setfillstyle(3,YELLOW);

rectangle(180,337,400,360);

floodfill(183,340,WHITE);


//EYES

ellipse(300,165,0,160,10,10);

circle(300,167,3);


//HOLES EXTRAS

circle(300,290,2);

circle(370,250,2);

ellipse(400,250,180,20,25,17);

ellipse(385,240,20,160,15,20);

ellipse(423,240,70,160,25,20);

line(430,220,420,245);

circle(410,195,3);

circle(390,195,3);

circle(400,200,3);

circle(400,210,3);


setcolor(YELLOW);

outtextxy(390,180,"OM");

setcolor(LIGHTRED);

settextstyle(3,HORIZ_DIR,4);

outtextxy(200,400,"LORD GANESHA");


setcolor(10);

settextstyle(7,0,2);

outtextxy(400,450,"-ROHIT TECH STUDY");

rectangle(0,400,630,450);


getch();

closegraph();

return 0;

}








LORD GANESH DRAW BY C PROGRAMMING LANGUAGE

 //___________ WELCOME ALL OF YOU ON ROHIT TECH STUDY CHANNEL ______________//

//_________________ C++ PROGRAM TO DRAW GANPATI BAPPA _____________________//


#include<stdio.h>

#include<conio.h>

#include<graphics.h>

#include<dos.h>

void main()

{

int gd,gm,i;

gm=gd=DETECT;

initgraph(&gm,&gd,"c://tc//bgi");


for(i=0;i<50;i++)

{

setcolor(i);


//_____________TUMMY____________//

ellipse(235,250,130,420,100,90);

//TUMMY POINT

ellipse(240,320,0,360,4,4);


//____________LEGS_______________//

ellipse(170,330,105,355,100,50);

ellipse(343,330,195,100,80,50);


//____________HEAD_______________//

ellipse(245,147,50,140,40,51);

ellipse(186,150,50,140,40,51);


//_____________EARS_______________//

arc(240,138,290,410,50);

arc(195,135,150,260,50);


//_____________TRUNK_______________//

setcolor(i+1);

ellipse(185,180,550,290,0,10);

ellipse(225,200,170,280,40,30);

ellipse(250,180,550,290,0,10);

ellipse(285,173,200,280,40,30);

ellipse(260,229,0,360,40,1);

ellipse(270,277,9,100,80,50);

ellipse(270,250,6,90,80,50);


//______________EYES____________________//

ellipse(200,150,0,70,10,10);

ellipse(240,150,98,180,10,10);

delay(500);

//______________TEXT____________________//

settextstyle(7,0,2);

outtextxy(5,5,"*_*_+_+-_+_ GANPATI BAPPA MORAYA _+-_+_-_+_-");

settextstyle(3,HORIZ_DIR,4);

outtextxy(5,390,"OM GAN GAPATAYE NAMO NAMAH !");

setcolor(10);

settextstyle(7,0,2);

outtextxy(400,450,"-ROHIT TECH STUDY");

}


getch();

closegraph();

}


Featured Post

Happy Republic Day Wish Using HTML and CSS | 26 January wish using HTML/CSS

 Happy Republic Day Wish Using HTML and CSS, 26 January wish using HTML/CSS <!-- WELCOME ALL OF YOU ON COMPUTER SOFT SKILLS CHANNEL -----...

Popular Posts