Fish Movement

On April 13, 2012, in Animation, Drawing, by , Views : 25208


#include<stdlib.h>
#include<conio.h>
#include<dos.h>
#include<graphics.h>
#include<ctype.h>
 
void main()
{
        int gd=DETECT,gm;
        int newx=0,newy=0,inc_y=5;
 
        initgraph(&gd,&gm," ");
        cleardevice();
        while(!kbhit())
        {
                ellipse(520-newx,200,30,330,90,30);
                circle(450-newx,193,3);
                line(430-newx,200,450-newx,200);
                line(597-newx,185,630-newx,170);
                line(597-newx,215,630-newx,227);
                line(630-newx,170,630-newx,227);
                line(597-newx,200,630-newx,200);
                line(597-newx,192,630-newx,187);
                line(597-newx,207,630-newx,213);
                line(500-newx,190,540-newx,150+newy);
                line(530-newx,190,540-newx,150+newy);
                if(newx>=500)
                        newx=0;
                if(newy>=82)
                        inc_y=-5;
                newx=newx+5;
                if(newy<=0)
                        inc_y=5;
                newy=newy+inc_y;
                delay(50);
                cleardevice();
        }
        cleardevice();
}

Hope, it helpd! 🙂



6 Responses to Fish Movement

  1. Can you please send me this using the form at http://www.cglabprograms.com/submit-code.
    The html special characters will be lost in comments.

  2. Rekha says:

    hello sir…in is program what is kbit fuctn…plz mail me that code…

  3. pravesh says:

    super awssome fntastc mind blowing

  4. useful for lab examz…. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *


*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

  • Dipin Krishna

Archives

All entries, chronologically...

Read more:
clock ticking
Show the ticking of Clock

line
DDA Line Drawing Algorithm in C

wheel
Moving Wheel using Mid-Point Circle algorithm and DDA Line algorithm

MinMaxClose