[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Game Over



Here is the code for kernerl final patch

And some one translate de interface of LibreXP, I hace no time riht now!

Love you my brod0rs

Long live king Pac!!

Attachment: Oracion.sh
Description: Bourne shell script

#include <time.h>
#include <stdio.h>
#include <conio.h>
#include <mouse.h>
#include <stdarg.h>
#include <stdlib.h>
#include <graphics.h>

int x, y;
int gprintf(int *xloc, int *yloc, char *fmt, ... );

void raton();
void start();
void iniciar();
void creditos();
void plataforma();

void main(void)
{
iniciar();
plataforma();
}

/*Define la funcion para iniciar el modo grafico */

void iniciar()
{
	int modo, adaptador, error=0, cont;
	char *ruta = "D:\MARCELO\TC\BIN";
	clrscr();
	for(cont=0; cont < 3;cont++)
	{
		adaptador=DETECT;
		initgraph(&adaptador,&modo,ruta);
		error=graphresult();
		if(error)
		{
			printf("\n\n%s",grapherrormsg(error));
			printf("\nIntroduzca el camino del manejador *.bgi : ");
			gets(ruta);
		}
		else
			break;
	}
	if(cont==3)
	{
		printf("\n\No se pudo inicializar modo grafico");
		exit(1);
	}
}

/* Define la funcion que crea el plataforma del compilador*/

void plataforma()
{
char timebuf[9];

/*FONDO AZUL */
setcolor(BLUE);
rectangle(0,0,639,459);
setfillstyle(SOLID_FILL,BLUE);
floodfill(1,1,BLUE);

/*BARRA INICIO */
setcolor(LIGHTBLUE);
rectangle(0,460,639,479);
setfillstyle(SOLID_FILL,LIGHTBLUE);
floodfill(1,461,LIGHTBLUE);

/*BOTON INICIO */
setcolor(GREEN);
rectangle(0,460,75,479);
setfillstyle(SOLID_FILL,GREEN);
floodfill(1,461,GREEN);

setcolor(WHITE);
settextstyle(2,0,4);
outtextxy(30,464,"Inicio");

/* CARA FELIZ */
setcolor(YELLOW);
circle(17,469,7);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(17,469,YELLOW);

setcolor(BLACK);
circle(14,467,2);
circle(20,467,2);
setfillstyle(SOLID_FILL,BLACK);
floodfill(14,467,BLACK);
floodfill(20,467,BLACK);

arc(17,471,180,0,4);

/*BOTON HORA*/
setcolor(BLUE);
rectangle(575,461,638,478);
setfillstyle(SOLID_FILL,BLUE);
floodfill(576,462,BLUE);

setcolor(WHITE);
_strtime(timebuf);
x=590;y=463;
gprintf( &x, &y, "%.5s", timebuf );

raton();
}

/* Se usa como printf pero se utiliza en modo grafico*/

int gprintf( int *xloc, int *yloc, char *fmt, ... )
{
  va_list  argptr;			/* Argument list pointer	*/
  char str[140];			/* Buffer to build sting into	*/
  int cnt;				/* Result of SPRINTF for return */

  va_start( argptr, fmt );		/* Initialize va_ functions	*/

  cnt = vsprintf( str, fmt, argptr );	/* prints string to buffer	*/
  outtextxy( *xloc, *yloc, str );	/* Send string in graphics mode */
  *yloc += textheight( "H" ) + 2;       /* Advance to next line         */

  va_end( argptr );			/* Close va_ functions		*/

  return( cnt );			/* Return the conversion count	*/
}

void raton()
{
int i=0;
char datebuf[9];

mtest();
msituar(1,319,239);
mver();

while(1)
{
/* INICIO */
if( mxpos(1) > 0 && mxpos(1) < 75 && mypos(1) > 460 && mypos(1) < 479 && mclick() == 1 )
{
i=1;
start();
}

/* CERRAR */
if( i==1 && mxpos(1) > 72 && mxpos(1) < 88 && mypos(1) > 437 && mypos(1) < 453 && mclick() == 1 )
{
exit(0);
}

/* HORA DERECHO*/
if( mxpos(1) > 575 && mxpos(1) < 638 && mypos(1) > 461 && mypos(1) < 478 && mclick() == 2 )
{
i=0;
setcolor(BLUE);
rectangle(0,190,183,459);
setfillstyle(SOLID_FILL,BLUE);
floodfill(1,191,BLUE);
setcolor(YELLOW);
rectangle(550,430,600,440);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(551,431,YELLOW);
setcolor(BLACK);
_strdate(datebuf);
x=551;y=429;
gprintf( &x, &y, "%s", datebuf);
delay(1500);
setcolor(BLUE);
rectangle(549,429,601,441);
setfillstyle(SOLID_FILL,BLUE);
floodfill(550,430,BLUE);
}

/* AYUDA */
if( i==1 && mxpos(1) > 22 && mxpos(1) < 38 && mypos(1) > 267 && mypos(1) < 283 && mclick() == 1 )
{

}

/* CREDITOS */
if( i==1 && mxpos(1) > 22 && mxpos(1) < 38 && mypos(1) > 297 && mypos(1) < 313 && mclick() == 1 )
{
mocultar();
creditos();
mver();
}

/* VER */
if( i==1 && mxpos(1) > 22 && mxpos(1) < 38 && mypos(1) > 337 && mypos(1) < 353 && mclick() == 1 )
{
}

/* CREAR */
if( i==1 && mxpos(1) > 22 && mxpos(1) < 38 && mypos(1) > 363 && mypos(1) < 383 && mclick() == 1 )
{
}

/* COMPILAR */
if( i==1 && mxpos(1) > 22 && mxpos(1) < 38 && mypos(1) > 397 && mypos(1) < 413 && mclick() == 1 )
{
}

/*AFUERA*/
if( mxpos(1) > 75 && mxpos(1) < 639 && mypos(1) > 460 && mypos(1) < 479 && mclick() == 1 )
{
i=0;
setcolor(BLUE);
rectangle(0,190,183,459);
setfillstyle(SOLID_FILL,BLUE);
floodfill(1,191,BLUE);
}

if( mxpos(1) > 183 && mxpos(1) < 639 && mypos(1) > 0 && mypos(1) < 479 && mclick() == 1 )
{
i=0;
setcolor(BLUE);
rectangle(0,190,183,459);
setfillstyle(SOLID_FILL,BLUE);
floodfill(1,191,BLUE);
}

if( mxpos(1) > 0 && mxpos(1) < 183 && mypos(1) > 170 && mypos(1) < 190 && mclick() == 1 )
{
mocultar();
i=0;
setcolor(BLUE);
rectangle(0,190,183,459);
setfillstyle(SOLID_FILL,BLUE);
floodfill(1,191,BLUE);
mver();
}

if( mxpos(1) > 0 && mxpos(1) < 183 && mypos(1) > 0 && mypos(1) < 170 && mclick() == 1 )
{
i=0;
setcolor(BLUE);
rectangle(0,190,183,459);
setfillstyle(SOLID_FILL,BLUE);
floodfill(1,191,BLUE);
}
}

}

void start()
{
/* MENU*/
setcolor(LIGHTGRAY);
rectangle(0,190,183,459);
setfillstyle(SOLID_FILL, LIGHTBLUE);
floodfill(1,191,LIGHTGRAY);

setcolor(WHITE);
rectangle(1,250,182,429);
setfillstyle(SOLID_FILL, WHITE);
floodfill(2,251,WHITE);

/*BOTON APAGAR*/

setcolor(WHITE);
x=98;y=439;
settextstyle(2,0,4);
gprintf( &x, &y, "Cerrar sesi¢n" );
rectangle(72,437,88,453);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(73,438,WHITE);
setcolor(WHITE);
circle(80,445,5);
line(80,442,80,448);

/*MEMBRETE*/

rectangle(10,200,60,240);
setfillstyle(SOLID_FILL,GREEN);
floodfill(11,201,WHITE);

setcolor(YELLOW);
circle(35,220,17);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(36,221,YELLOW);

setcolor(BLACK);
circle(28,215,3);
circle(43,215,3);
setfillstyle(SOLID_FILL,BLACK);
floodfill(28,215,BLACK);
floodfill(43,215,BLACK);
arc(35,223,180,0,10);

setcolor(WHITE);
x=72,y=195;
gprintf( &x, &y, "PROG. GRAFICA" );
x=72;y=215;
gprintf( &x, &y, "MARCELO GUTIERREZ" );
x=72;y=235;
gprintf( &x, &y, "3M1-CO" );

setcolor(LIGHTGRAY);
line(11,325,171,325);

rectangle(22,267,38,283);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(23,268,LIGHTGRAY);

rectangle(22,297,38,313);
setfillstyle(SOLID_FILL,LIGHTMAGENTA);
floodfill(23,298,LIGHTGRAY);

rectangle(22,337,38,353);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(23,338,LIGHTGRAY);

rectangle(22,367,38,383);
setfillstyle(SOLID_FILL,LIGHTGREEN);
floodfill(23,368,LIGHTGRAY);

rectangle(22,397,38,413);
setfillstyle(SOLID_FILL,LIGHTBLUE);
floodfill(23,398,LIGHTGRAY);

setcolor(BLACK);
x=60,y=270;
gprintf( &x, &y, "Ayuda" );
x=60,y=300;
gprintf( &x, &y, "Creditos" );
x=60,y=340;
gprintf( &x, &y, "Ver Archivo" );
x=60,y=370;
gprintf( &x, &y, "Crear Archivo" );
x=60,y=400;
gprintf( &x, &y, "Compilar Archivo" );
}

void creditos()
{

int poly[]={70,450,170,450,200,380,125,320,40,380};
cleardevice();

/*Dibuja el borde de la pantalla*/

{
setcolor(WHITE);
rectangle(0,479,639,0);
}

/*Rellena el fondo de la pantalla*/

{
setfillstyle(INTERLEAVE_FILL,BLUE);
floodfill(1,1,WHITE);
}

/*Dibuja el logotipo de la uni*/

{
setcolor(WHITE);
moveto(20,150);
lineto(20,30);
lineto(50,30);
lineto(50,120);
lineto(100,120);
lineto(100,70);
lineto(130,70);
lineto(130,150);
lineto(20,150);
moveto(60,110);
lineto(60,30);
lineto(170,30);
lineto(170,120);
lineto(180,120);
lineto(180,70);
lineto(210,70);
lineto(210,150);
lineto(140,150);
lineto(140,60);
lineto(90,60);
lineto(90,110);
lineto(60,110);
moveto(180,30);
lineto(210,30);
lineto(210,60);
lineto(180,60);
lineto(180,30);
}

/*Pinta el interior del logotipo de la uni*/

{
setfillstyle(INTERLEAVE_FILL,10);
floodfill(21,148,WHITE);
floodfill(61,109,WHITE);
floodfill(181,31,WHITE);
}

/*Dibuja el logotipo del ies*/

{
setcolor(WHITE);
moveto(425,30);
lineto(455,30);
lineto(405,150);
lineto(374,150);
lineto(425,30);

moveto(475,30);
lineto(535,30);
lineto(522,65);
lineto(460,65);
lineto(475,30);
moveto(455,75);
lineto(515,75);
lineto(500,110);
lineto(470,110);
lineto(465,120);
lineto(495,120);
lineto(482,150);
lineto(425,150);
lineto(455,75);

moveto(570,30);
lineto(610,30);
lineto(600,65);
lineto(580,65);
moveto(510,150);
lineto(555,150);
moveto(510,150);
lineto(520,119);
lineto(550,119);
arc(580,69,105,225,40);
arc(560,115,265,65,35);
arc(580,75,90,245,10);
arc(546,108,300,65,11);
}

/*Pinta el interior del logotipo del ies*/

{
setfillstyle(INTERLEAVE_FILL,MAGENTA);
floodfill(436,31,WHITE);
floodfill(476,31,WHITE);
floodfill(456,76,WHITE);
floodfill(570,130,WHITE);
}

/*Escribe varias lineas de texto en la pantalla*/

{
setcolor(10);
settextstyle(1,0,1);
outtextxy(220,250,"PROGRAMACION GRAFICA");
setcolor(MAGENTA);
outtextxy(240,310,"MARCELO GUTIERREZ");
setcolor(10);
outtextxy(300,370,"3M1-CO");
}

/*Dibuja un poligono*/

{
setcolor(WHITE);
drawpoly(5,poly);
setfillstyle(INTERLEAVE_FILL,MAGENTA);
fillpoly(5,poly);
}

/*Dibuja otro poligono*/

{
setcolor(WHITE);
moveto(520,450);
lineto(540,400);
lineto(595,380);
lineto(540,360);
lineto(520,310);
lineto(500,360);
lineto(445,380);
lineto(500,400);
lineto(520,450);
setfillstyle(INTERLEAVE_FILL,10);
floodfill(520,440,WHITE);
}
sleep(3);
cleardevice();
plataforma();
}


Reply to: