Thursday, 29 September 2011

A simple animation in C (turbo c++ compiler)

with 0 comments

#include

#include

#include

void main()

{

int i,x1=15,x2=60,y1=20,y2=5;

clrscr();

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

{

gotoxy(x1,5);

textcolor(i%15);

cprintf("*");

gotoxy(x2,20);

cprintf("*");

x2-=2;

delay(50);

x1+=2;

}

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

{

gotoxy(15,y1);

textcolor(i);

cprintf("*");

gotoxy(60,y2);

cprintf("*");

delay(50);

y1-=1;

y2+=1;

}

x1=15,x2=60,y1=20,y2=5;

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

{

textcolor(i+6);

gotoxy(x1,4);

cprintf("/");

gotoxy(x2,21);

cprintf("/");

delay(50);

x1+=2;

x2-=2;

}

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

{

gotoxy(13,y1);

textcolor(i+1);

cprintf("/");

gotoxy(62,y2);

cprintf("/");

delay(50);

y1-=1;

y2+=1;

}

gotoxy(33,6);

textcolor(9);

cprintf("P"); delay(200);

cprintf("R"); delay(200);

cprintf("O"); delay(200);

cprintf("J"); delay(200);

cprintf("E"); delay(200);

cprintf("C"); delay(200);

cprintf("T "); delay(200);

cprintf("O"); delay(200);

cprintf("N"); delay(200);

textcolor(11+BLINK);

gotoxy(25,7);

cprintf("ATM"); delay(300);

cprintf(" MANAGEMENT"); delay(300);

cprintf(" SYSTEM"); delay(500);

textcolor(5);

gotoxy(20,9);

cprintf("Created By");

gotoxy(45,9);

cprintf("Guided By");

gotoxy(20,10);

cprintf("----------");

gotoxy(45,10);

cprintf("----------");

textcolor(2);

gotoxy(18,11);

cprintf("1.PAPU BHOI");

gotoxy(18,12);

cprintf("2.Student 2");

gotoxy(18,13);

cprintf("3.Student 3");

gotoxy(18,14);

cprintf("4.Student 4");

gotoxy(18,15);

cprintf("5.Student 5");

gotoxy(44,11);

cprintf("1.TEACHER NAME");

gotoxy(44,12);

cprintf("2.TEACHER NAME");

textcolor(BLUE);

gotoxy(18,18);

cprintf("YUVODAYA COLLEGE OF ADVANCED TECHONOLOGY");

textcolor(RED);

gotoxy(50,24);

cprintf("PRESS ANY KEY TO CONTINUE...");

getch();

}

I made this animation for a project in my College. You can change here as your wish. Copy this code and paste it in notepad and save it as .c exetension. Then open it with turbo c++ and press ctrl+f9 to run.... Hope You Enjoy

0 comments:

Post a Comment