Jumat, 30 Desember 2011

Coding Animasi Bilyard menggunakan Turbo C

#include<graphics.h>
void main()
{
  int a,k,i,j;
  int gd=DETECT, gm;
  initgraph(&gd,&gm,"");

  /*MEJA I*/
  setcolor(2+4);
  setfillstyle(1,2+4);
  rectangle(0,0,640,480);
  floodfill(1,1,2+4);


  /*MEJA 2*/
  setcolor(2);
  setfillstyle(1,2);
  rectangle(20,20,620,460);
  floodfill(21,21,2);



  /*LINE PUTIH*/
  setcolor(WHITE);
  rectangle(30,30,610,450);


  /*LUBANG KRI-ATS*/
  setcolor(BLACK);
  setfillstyle(1,BLACK);
  circle(20,20,15);
  floodfill(20,20,BLACK);

  /*LUBANG TGH-ATS*/
  setcolor(BLACK);
  setfillstyle(1,BLACK);
  circle(320,20,15);
  floodfill(320,20,BLACK);

  /*LUBANG KAN-ATS*/
  setcolor(BLACK);
  setfillstyle(1,BLACK);
  circle(620,20,15);
  floodfill(620,20,BLACK);

  /*LUBANG KAN-BWH*/
  setcolor(BLACK);
  setfillstyle(1,BLACK);
  circle(620,460,15);
  floodfill(620,460,BLACK);

  /*LUBANG TGH-BWH*/
  setcolor(BLACK);
  setfillstyle(1,BLACK);
  circle(320,460,15);
  floodfill(320,460,BLACK);

  /*LUBANG KRI-BWH*/
  setcolor(BLACK);
  setfillstyle(1,BLACK);
  circle(20,460,15);
  floodfill(20,460,BLACK);

  /*BOLA BIRU*/
  setcolor(1);
  setfillstyle(1,1);
  circle(320,160,10);
  floodfill(320,160,1);

  /*BOLA UNGU*/
  setcolor(5);
  setfillstyle(1,5);
  circle(430,265,10);
  floodfill(430,265,5);

  /*BOLA MERAH*/
  setcolor(4);
  setfillstyle(1,4);
  circle(370,155,10);
  floodfill(370,155,4);

  /*BOLA PUTIH2*/
  setcolor(WHITE);
  setfillstyle(1,WHITE);
  circle(320,312,10);
  floodfill(320,312,WHITE);

  /*STICK*/
  setcolor(6);
  setfillstyle(1,6);
  rectangle(318,370,324,480);
  floodfill(319,371,6);


  for(i=370; i<=430; i++)
  {
  setcolor(6);
  rectangle(318,i,324,480);
  delay(10000);
  setcolor(2);
  rectangle(318,i,324,480);
  }

  for(i=480; i>=325; i--)
  {
  setcolor(6);
  rectangle(318,430,324,i);
  delay(4500);
  setcolor(6);
  rectangle(318,430,324,i);
  }

  /*BOLA PUTIH3*/
  for(i=312; i>=182; i--)
  {
  setcolor(WHITE);
  setfillstyle(1,WHITE);
  circle(320,i,10);
  floodfill(320,i,WHITE);
  delay(1000);
  setcolor(2);
  setfillstyle(1,2);
  circle(320,i,10);
  floodfill(320,i,2);
  }

  /*BOLA PUTIH4*/
  setcolor(WHITE);
  setfillstyle(1,WHITE);
  circle(320,182,10);
  floodfill(320,182,WHITE);

  /*BOLA BIRU*/
  for(i=160; i>=20.5; i--)
  {
  setcolor(1);
  setfillstyle(1,1);
  circle(320,i,10);
  floodfill(320,i,1);
  delay(1000);
  setcolor(2);
  setfillstyle(1,2);
  circle(320,i,10);
  floodfill(320,i,2);
  }

  setcolor(BLACK);
  setfillstyle(1,BLACK);
  circle(320,i,15);
  floodfill(320,i,BLACK);

  /*CREATED BY :*/
  settextstyle(1,0,4);
  outtextxy(60,50,"'Created By : Riry'");


  getche();
  closegraph();
}

3 komentar:

Anand's here mengatakan...

tetap masih ada banyak koreksi yg hrus dilakukan...ri..but good creativity. Copy paste...

Anand's here mengatakan...

hahaha from anand.....

Rry mengatakan...

kirain siapaaa lah si 'haha' ini. rupanya si anand. xD
koreksi yg gimana nih? kasih tau lah nan, jadi kan rry bisa perbaiki ^_^
copas? WHATT? (heheh) ywd , gpp deh..

Posting Komentar

Template by:
Free Blog Templates