void submenu() { int i; //////pintar menu setbkcolor(WHITE); settextstyle(2,0,0); box(0,0,getmaxx(),getmaxy(),1,0); //for (i=1;i<1000;i=i+1)putpixel(rand()%640,rand()%480,RED); box(10,0,110,40,1,7); outtextxy(20,10,"Batallas"); box(120,0,230,40,1,7); outtextxy(130,10,"Trofeos"); box(240,0,350,40,1,7); outtextxy(250,10,"Guardar"); box(530,0,600,40,1,7); outtextxy(540,10,"Salir"); ////////////// box(10,40,110,60,1,7); outtextxy(40,45,"Batalla 1"); box(10,60,110,80,1,7); outtextxy(40,65,"Batalla 2"); box(10,80,110,100,1,7); outtextxy(40,85,"Batalla 3"); box(10,100,110,120,1,7); outtextxy(40,105,"Batalla 4"); box(10,120,110,140,1,7); outtextxy(40,125,"Batalla 5"); }
void intro() { int i,j; clrscr(); cleardevice(); setbkcolor(BLACK); gotoxy (25,12); settextstyle(4,0,6); for(i=0; i<=10; i++) { setcolor(i%16); outtextxy(2,2,"SHUFFLE GAME"); settextstyle(1,0,7); outtextxy(20,200,""); delay(100); outtextxy(180,200,"1"); delay(100); outtextxy(220,200,"2"); delay(100); outtextxy(260,200,"3"); delay(100); outtextxy(180,300,"4"); delay(100); outtextxy(220,300,"5"); delay(100); outtextxy(260,300,"6"); delay(100); outtextxy(180,400,"7"); delay(100); outtextxy(220,400,"8"); settextstyle(4,0,8); delay(100); getch(); } }
void uno() { clearviewport(); setbkcolor(0); fillellipse(320,240,100,50); getch(); }
void popup() { int x1,x2,y1,y2, i, nRec = 13; // Numero de rectangulos x1 = x2 = (WIDTH/2); y1 = y2 = (HEIGHT/2); setfillstyle(1,0x00CCFF); for(i=0; i<nRec; x1-=15, y1-=10, x2+=15, y2+=10, i++) { bar(x1, y1, x2, y2); delay(15); } // ¡PERDISTE! setbkcolor(0x00CCFF); setcolor(0x0054D3); settextstyle(3, HORIZ_DIR, 6); outtextxy(WIDTH/2-textwidth("¡PERDISTE!")/2, y1+textheight("P")/2, "¡PERDISTE!"); setcolor(0x4b78F2); settextstyle(3, HORIZ_DIR, 3); outtextxy(WIDTH/2-textwidth("Presiona cualquier tecla")/2, y1+textheight("P")*4, "Presiona cualquier tecla"); settextstyle(3, HORIZ_DIR, 3); outtextxy(WIDTH/2-textwidth("para continuar")/2, y1+textheight("P")*5, "para continuar"); }
void end() { int i,j,k; int gd=DETECT,gm; initgraph(&gd,&gm,"c:\\tc\\bgi"); setbkcolor(BROWN); setcolor(RED); settextstyle(1,0,8); outtextxy(130,50,"_-~Search~-_"); setcolor(RED); settextstyle(1,0,8); outtextxy(10,190,"_-~For me~-_"); settextstyle(7,0,3); setcolor(RED); setcolor(10+BLINK); outtextxy(300,300,"THANK YOU"); setcolor(10); outtextxy(300,355,"Have a nice day....."); setcolor(4); for(k=0;k<640;k++) { if(k==635) { for(j=0;j<480;j++) { circle(635,j,4); delay(1); } } else { circle(k,5,5); delay(1); } } for(k=639;k>(-1);k--) { if(k==0) { for(j=475;j>0;j--) { circle(5,j,5); delay(1); } } else { circle(k,475,4); delay(1); } } restorecrtmode(); }
void main() { int ch; clrscr(); while(1) { initgraph(&gdriver, &gmode, ""); errorcode = graphresult(); if (errorcode != grOk) { printf("%d",errorcode); printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); } cleardevice(); setbkcolor(6); setcolor(15); settextstyle(1,0,1); sprintf(msg,"SRI JAYACHAMARAJENDRA COLLEGE OF ENGINEERING"); outtextxy(75,10,msg); sprintf(msg,"MYSORE-570006"); outtextxy(230,40,msg); sprintf(msg,"STUDENT DATABASE"); outtextxy(220,100,msg); sprintf(msg,"1. INSERT A RECORD"); outtextxy(200,200,msg); sprintf(msg,"2. ACCESS A RECORD"); outtextxy(200,240,msg); sprintf(msg,"3. DELETE A RECORD"); outtextxy(200,280,msg); sprintf(msg,"4. DISPLAY THE DATABASE"); outtextxy(200,320,msg); sprintf(msg,"5. EXIT"); outtextxy(200,360,msg); sprintf(msg," Please enter your choice:"); outtextxy(220,400,msg); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); printf("\n\t\t\t\t\t"); scanf("%d",&ch); clrscr(); switch(ch) { case 1:write(); break; case 2:read(); break; case 3:del(); break; case 4:display(); break; case 5:exit(0); default:printf("Wrong Choice:Please enter a valid choice"); } getch(); closegraph(); } }
void guardar() { inicializa(); setbkcolor(7); settextstyle(3,0,4); outtextxy(100,50,"Escriba nombre para la partida"); capturacadena(100,100); }
void resetWindow() { //Sets background color to GREEN setbkcolor (GREEN); //Sets drawing color to WHITE setcolor(WHITE); clearviewport(); }
void Ventana::Error(char *p) { setbkcolor(YELLOW); setcolor (BLACK); outtextxy(0,0,p); getch(); closegraph(); exit (1); }
void main() { int gd=DETECT,gm; initgraph(&gd,&gm,"NULL"); setbkcolor(BLUE); outtextxy(200,200,"COMPUTER GRAPHICS"); getch(); closegraph(); }
void canvas_begin_draw( void ) { drawing = true; setactivepage( canvas_inactive_page() ); cleardevice(); setbkcolor(WHITE); return; }
int main(){ initgraph(500,600); setbkcolor(EGERGB(0x0, 0x40, 0x0)); setcolor(1); rectangle(100,100,300,500); getch(); closegraph(); return 0; }
void first() { int i,j,k; int gd=DETECT,gm; initgraph(&gd,&gm,"c:\\tc\\bgi"); setbkcolor(BROWN); setcolor(RED); settextstyle(1,0,8); outtextxy(130,50,"_-~Search~-_"); setcolor(RED); settextstyle(1,0,8); outtextxy(10,190,"_-~For Me~-_"); settextstyle(7,0,3); setcolor(RED); setcolor(10); setcolor(4); for(k=0;k<640;k++) { if(k==635) { for(j=0;j<480;j++) { circle(635,j,4); delay(1); } } else { circle(k,5,5); delay(1); } } for(k=639;k>(-1);k--) { if(k==0) { for(j=475;j>0;j--) { circle(5,j,5); delay(1); } } else { circle(k,475,4); delay(1); } } getch(); restorecrtmode(); }
void tienda() { int i, xi, pag = 1, huesos, pos = 0; // Posicion del indicador. char tecla; String aux; obtenerDatos(&huesos, &i); setvisualpage(pag); while(tecla!=27) { setactivepage(pag=!pag); setfillstyle(1, COLOR(79, 182, 225)); bar(0,0, WIDTH, HEIGHT); dibujaHuesos(huesos); setfillstyle(1, 0x00f); for(i=0, xi=WIDTH/3; i<NSKINS; i++, xi+=PIXEL_TAM*25) if(pos==i) bar(xi, 450+PIXEL_TAM*25, xi+PIXEL_TAM*20, 460+PIXEL_TAM*25); if(kbhit()) switch(tecla = getch()) { case 13: compra(pos+1); obtenerDatos(&huesos, &i); break; case 77: if(pos!=2) pos++; break; case 75: if(pos!=0) pos--; break; } setbkcolor(0x0066F4); setfillstyle(1, 0x0066F4); setcolor(0x003988); settextstyle(2, HORIZ_DIR, 8); for(i=0, xi=WIDTH/3; i<NSKINS; i++, xi+=PIXEL_TAM*25) { sprintf(aux, "dino%d.%d.txt", i+1,pag); dibujaSprite(aux, xi, 450); sprintf(aux, "$ %d", 300*i); if(i) outtextxy(xi, 460+PIXEL_TAM*25, aux); } setvisualpage(pag); delay(80); } iniciaEntorno(); }
void init(int color) { int drive,mode; drive=DETECT; registerbgidriver(EGAVGA_driver); initgraph(&drive,&mode,""); setbkcolor(color); }
void main() { int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi"); intro(); levelmenu(); clrscr(); cleardevice(); setbkcolor(RED); easy(); }
void init(int* gd, int* gm) { initgraph(gd, gm, "c:\\tc\\bgi"); clrscr(); max.x = getmaxx(); max.y = getmaxy(); origin.x = max.x/2; origin.y = max.y/2; setbkcolor(BLUE); setcolor(CYAN); line(0,origin.y, max.x,origin.y); line(origin.x,0, origin.x,max.y); setcolor(RED); }
main() { int driver = DETECT, mode; initgraph(&driver, &mode, ""); setbkcolor(BLUE); setcolor(WHITE); move(); getch(); closegraph(); }
int main (int argc, char **argv) { int gd, gm; int col; unsigned int seed; long int counter; float j, k, x, y, xx, xp, yp, r, xoffs, yoffs; if (argc == 2) seed = atoi (argv [1]); /* no checks! */ else { printf ("Seed: "); j = scanf ("%d", &seed); } srand (seed); // random each time: // srand (time(NULL)); gd = X11; gm = getmaxmode (); initgraph(&gd, &gm, ""); setbkcolor (BLACK); cleardevice (); setcolor (YELLOW); outtextxy (0, 0, "Press a key or click to exit: "); xoffs = getmaxx () / 2; yoffs = getmaxy () / 3; j = random (100); k = random (100); x = y = xx = xp = yp = r = 0.0; col = 1; /* colours codes run from 0 (black) to 15 (white) */ counter = 0; setcolor (col); while (!kbhit () && !mouseclick ()) { xx = y - sgn (x) * sqrt (abs (k * x - 1)); y = j - x; x = xx; xp = x * 2 + xoffs; yp = y * 2 + yoffs; _putpixel (xp, yp); if (++counter == 20000) { counter = 0; col++; if (col == 16) col = 1; } setcolor (col); } closegraph (); return 0; }
void bullet(int i) { setbkcolor(0); int j; for(j=425;j>=0;j-=25) {circle(325+i,j,3); floodfill(327+i,j+1,RED); if((322+i<=::x)&&(328+i>=::x)&&(j==::y)) {::l++;if(::l<20){blast(i,j);break;} if(::l==20){getch();delay(1000);blast(i,j);score(i,::l,::shots);}} delay(15); sound(600);delay(1);nosound(); target(i);} }
int main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); outtext("Welcome to the rail booking system\n"); getch(); setbkcolor(WHITE); /*Sets background colour to White*/ setcolor(BLACK); /*Sets colour to Black*/ getch(); closegraph(); return 0; }
void main() { int gd=DETECT,gm,i=370; char ch; clrscr(); initgraph(&gd,&gm,"C:\\TC\\bgi"); setbkcolor(WHITE); do{ setcolor(BLUE); line(100,400,500,400); setcolor(BLUE); circle(300,370,30); // rectangle(294,365,306,375); setfillstyle(1,RED); floodfill(300,370,BLUE); settextstyle(3,0,1); outtextxy(100,410,"Press space to Jump!"); outtextxy(360,410,"Press x to exit!"); ch=getch(); fflush(stdin); if(ch==' ') { do { delay(60); cleardevice(); setcolor(BLUE); line(100,400,500,400); setcolor(BLUE); i=i-50; circle(300,i,30); setfillstyle(1,RED); floodfill(300,i,BLUE); }while(i>100); do {delay(60); cleardevice(); setcolor(BLUE); line(100,400,500,400); setcolor(BLUE); i=i+50; circle(300,i,30); setfillstyle(1,RED); floodfill(300,i,BLUE); }while(i<370); cleardevice(); } else break; while(kbhit()) ch=getch(); }while(1); cleardevice(); //getch(); closegraph(); }
int main() { int gdriver = DETECT, gmode; initgraph(&gdriver, &gmode, ""); setbkcolor(WHITE); Point p[4] = { Point{0,0}, Point{100,0}, Point{100,100}, Point{0,100} }; int ch; cleardevice(); drawAxis(BLACK); for(int i = 0; i<4; i++) { Line l = {p[i], p[(i+1)%4]}; l.plotLineDDA(RED); } while((ch = getKeyCode())!=ESC) { switch(ch) { case 'A' : for(int i = 0; i<4; i++) { rotateSingle(&p[i], toRadian(10)); } break; case 'W' : for(int i = 0; i<4; i++) { translateSingle(&p[i], 10,10); } break; case 'D' : for(int i = 0; i<4; i++) { scaleSingle(&p[i], 1.5, 1.5); } break; } cleardevice(); drawAxis(BLACK); for(int i = 0; i<4; i++) { Line l = {p[i], p[(i+1)%4]}; l.plotLineDDA(RED); } } return 0; }
void rect(int i) { setbkcolor(0); if(300+i<=0) keyhit(i+=10); else if(350+i>=640) keyhit(i-=10); else {setlinestyle(DASHED_LINE,1,2); rectangle(300+i,429,350+i,436); setlinestyle(SOLID_LINE,1,2); rectangle(310+i,419,340+i,429); rectangle(322+i,409,328+i,419); setcolor(GREEN); line(10,438,630,438); setfillstyle(SOLID_FILL,6); bar(10,440,630,445);floodfill(12,441,6); setcolor(1); settextstyle(11,0,4); outtextxy(80,460,"Designed and Developed by <<::>> Tejendra Singh & Shubham Singh"); setcolor(RED); settextstyle(11,0,4); outtextxy(15,20,"Score:"); setcolor(WHITE); circle(303+i,432,3); circle(312+i,432,3); circle(324+i,432,3); circle(336+i,432,3); circle(347+i,432,3); setcolor(i+1); outtextxy(10,50,"."); setcolor(i+1); outtextxy(20,100,"."); setcolor(i+2); outtextxy(30,150,"."); setcolor(i+3); outtextxy(50,50,"."); setcolor(i+4); outtextxy(90,200,"."); setcolor(i+5); outtextxy(420,277,"."); setcolor(i+6); outtextxy(150,110,"."); setcolor(i+7); outtextxy(350,300,"."); setcolor(i+8); outtextxy(200,140,"."); setcolor(i+9); outtextxy(550,280,"."); setcolor(i+10); outtextxy(300,250,"."); setcolor(i+11); outtextxy(560,260,"."); setcolor(i+12); outtextxy(400,70,"."); setcolor(i+13); outtextxy(15,239,"."); setcolor(i+14); outtextxy(450,166,"."); setcolor(i+15); outtextxy(300,59,"."); setcolor(i+16); outtextxy(500,80,"."); setcolor(i+17); outtextxy(290,95,"."); setcolor(i+18); outtextxy(530,89,"."); setcolor(i+19); outtextxy(150,305,"."); setcolor(RED); } }
void top() { initwindow(1275,700); setfillstyle(1,1); floodfill(100,100,1); setcolor(12); setbkcolor(BLUE); settextstyle(0,0,2); outtextxy(925,670,"Press any key to go back"); }
void Style::normal_outtext() { setlinestyle(SOLID_LINE, 0, NORM_WIDTH); setcolor(BLACK); setfillstyle(SOLID_FILL, WHITE); setbkcolor(WHITE); if (item) { rectangle(item->layer->startx, item->layer->starty, item->layer->endx, item->layer->endy); bar(item->layer->startx + 1, item->layer->starty + 1, item->layer->endx, item->layer->endy); outtextxy((item->layer->endx + item->layer->startx - textwidth(text)) / 2, (item->layer->endy + item->layer->starty - textheight(text)) / 2, text); } }
void runkernel(void) { cleardevice(); setbkcolor(0); int id,l,count=0; Control.First=0; Control.Free=50; id=Number+1; while((Control.Free<50)||(Number==-1)) { while(bioskey(1)!=0) { count++; bioskey(0); biuldwait(id); id++; Number++; } if((wt==wh&&wh==0)||(wt!=wh)) biuldmem();/*Biuld all can*/ cleardevice(); setbkcolor(0); drawgrid(); run(); finish(); compress(); display(); delay(2000); } setcolor(0); for(int a=0;a<629;a++) { moveto(a,390); lineto(a,425); moveto(a,445); lineto(a,460); } setcolor(YELLOW); outtextxy(180,450,"All the processes have been done!"); getch(); }
void main(void) { int dr = DETECT, mode, errorcode; int r1,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10,i11,i12; clrscr(); initgraph(&dr, &mode, "f:\\comp\\c\\bc\\bgi"); errorcode = graphresult(); if (errorcode != 0) { printf(" graphics Error :%s\n", grapherrormsg(errorcode)); exit(1); } /* for(r1=0;r1<15;++r1){*/ setcolor(4); setbkcolor(1); i2=0; i1=30; /* i3=100; i4=100; i5=150; i6=350; i7=390; i8=400; i9=500; i10=220; i11=340; i12=0; */ while(i2<220) { ++i2; /* ++i3; --i4; ++i5; --i6; --i7; --i8; --i9; ++i12; cleardevice(); int i[12] = {i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 }; drawpoly(6, i); */ cleardevice(); outtextxy(i1,i2, " ö‘þ‘•"); outtextxy(i1,(i2+40),"¢þøª üõ š¤‘¡ ô—¨þ¨ ¥� öø÷î�"); outtextxy(i1,(i2+80)," ¤�¢úð÷ �¢¡"); settextstyle(0,0,2); } getch(); closegraph(); }
help() { char *menu[]={"How To Play","Selecting Option","Credits","About Me","Back"}; int w=0,k,g=130,h=200; setbkcolor(0); settextstyle(3,0,3); setpos(0,0); viewport(); settextstyle(7,0,5); setcolor(14); outtextxy(245,100,"HELP"); settextstyle(1,0,2); setcolor(8); for(k=0;k<5;k++) { outtextxy(g,h,menu[k]); h+=textheight(menu[k])+10; } setpos(0,0); status("Select Any one using mouse pointer"); while(1) { pos(&button,&n,&m); w=opt2(n,m); settextstyle(1,0,2); g=130; h=200; for(k=0;k<5;k++) { if(w==k+1) { setcolor(11); outtextxy(g,h,menu[k]); h+=textheight(menu[k])+10; if(button==1) return w; } else { setcolor(8); outtextxy(g,h,menu[k]); h+=textheight(menu[k])+10; } } if(kbhit()) goto pr; } // getch(); pr: return 0; }
int main() { setinitmode(INIT_ANIMATION); initgraph(SCREEN_WIDTH, SCREEN_HEIGHT); ege_enable_aa(true); setbkcolor(WHITE); setcolor(EGERGBA(0, 0, 0, 255)); // loops; test_2d_gridding_implicitly(); closegraph(); }