Walking Man - Graphics Programming - Libgraph - GCC - Graphics & Multimedia Lab - C++ Program

Walking Man
Graphics Programming 
GCC - Graphics & Multimedia Lab - C++ Program

Source code:
#include<graphics.h>
using namespace std;

int main()
{
    int gd=DETECT, gm;
    initgraph(&gd, &gm,NULL);
    int i,walk=0;
    
    setcolor(BROWN);
    bar3d(10,280,getmaxx()-50,320,10,50);
    outtextxy(200,300,"www.2k8618.blogspot.com");
    
    setcolor(WHITE);
    circle(70,140,30);
    circle(60,130,3);
    circle(80,130,3);
    line(70,135,70,145);
    //line(65,155,75,155);
    arc(70,140,60,120,15);
        
    line(70,170,70,220);
    line(70,170,50,220);
    line(70,170,90,220);
    line(70,220,55,270);
    line(70,220,85,270);
    
    setcolor(9);
    fillellipse(150,100,60,40);
    outtextxy(110,90,"hi," );
    outtextxy(110,100,"go for a walk?");       
    
    delay(5000);
    
    for(i=0;i<30;i++)
    {
        
   /*
    cleardevice();
    walk+=5;     
    bar3d(10,280,getmaxx()-50,320,10,50);
    circle(70+walk,140,30);
    line(70+walk,170,70+walk,220);
    line(70+walk,170,40+walk,220);
    line(70+walk,170,100+walk,220);
    line(70+walk,220,30+walk,270);
    line(70+walk,220,110+walk,270);
    delay(500);*/
    
    walk+=5; 
    
    cleardevice();
    
    setcolor(BROWN);
    bar3d(10,280,getmaxx()-50,320,10,50);
    outtextxy(200,300,"www.2k8618.blogspot.com");
    
    setcolor(WHITE);
    circle(70+walk,140,30);
    line(70+walk,170,70+walk,220);
    line(70+walk,170,50+walk,220);
    line(70+walk,170,90+walk,220);
    line(70+walk,220,55+walk,270);
    line(70+walk,220,85+walk,270);
    
    delay(250);
    
    walk+=5;
    
    cleardevice();
    
    circle(70+walk,140,30);
    line(70+walk,170,70+walk,270);
    
    setcolor(BROWN);
    bar3d(10,280,getmaxx()-50,320,10,50);
    outtextxy(200,300,"www.2k8618.blogspot.com");
    
    delay(250);
    
    walk+=5;
    
    cleardevice();
    
    bar3d(10,280,getmaxx()-50,320,10,50);
    outtextxy(200,300,"www.2k8618.blogspot.com");
    
    setcolor(WHITE);
    circle(70+walk,140,30);
    line(70+walk,170,70+walk,220);
    line(70+walk,170,60+walk,220);
    line(70+walk,170,80+walk,220);
    line(70+walk,220,55+walk,270);
    line(70+walk,220,85+walk,270);
    
    delay(250);
    
    }
    
    circle(60+walk,130,3);
    circle(80+walk,130,3);
    line(70+walk,135,70+walk,145);
    line(65+walk,155,75+walk,155);
    //arc(70,140,60,120,15);
    
    setcolor(8);
    fillellipse(walk-10,100,60,40);
    outtextxy(walk-30,100,"lonely...");       
    
    delay(2500);
    
    getch();
    closegraph();
    return 0;
}

Output:


1 comment:

Related Posts Plugin for WordPress, Blogger...