Exemple #1
0
void Muestra_prsj1(int x, int y)
{

u16 new_x=x, new_y=y, spazo_i=0, i;
u16 cambioframe, longitud = 4;
u16 frame;
u16 boton;
u16 lado = ss, estilo = normal;
u16 vel, velMin = 1, velMax=2;

while(DreamSoft_Never_Die) {

	boton = joypad();

	if(boton) {

		if(frame>7) frame = 0;

		if (!(boton & J_B)) vel=velMax;
		if ((boton & J_B)) vel=velMin;

		if (!(boton & J_A)) { if(spazo_i%7==0)estilo=spazo[spazo_i/7]; spazo_i++; if(spazo_i>4*7) {spazo_i=0; estilo=normal; frame = 0;} }

		if (!(boton & J_DOWN))
		{ if(cambioframe==longitud){frame++; cambioframe=0;} new_y=y+vel; cambioframe++; lado=down;}
		if (!(boton & J_UP))
		{ if(cambioframe==longitud){frame++; cambioframe=0;}; new_y=y-vel; cambioframe++; lado=up;}
		if (!(boton & J_RIGHT))
		{ if(cambioframe==longitud){frame++; cambioframe=0;} new_x=x+vel; cambioframe++; lado=right;}
		if (!(boton & J_LEFT))
		{ if(cambioframe==longitud){frame++; cambioframe=0;} new_x=x-vel; cambioframe++; lado=left;}

	}

	if ( x != new_x && superficie(new_x,y,CAMINABLE) ) x = new_x;
	if ( y != new_y && superficie(x,new_y,CAMINABLE) ) y = new_y;

	if(x==240) for(; ;x--) { Muestra_prsj1_(x,y,frames[frame], lado, estilo); if(x<=1) break;}

	Muestra_prsj1_(x,y,frames[frame], lado, estilo);
}

}
Exemple #2
0
int main() {
	char cadena[1024],c;
	char * sep;
	archivo = fopen("casas.txt","r");
	if(archivo != NULL){
		while(feof(archivo) == 0){
			fgets(cadena,1024,archivo);
		}
	}
	else
		archivo = fopen("casas.txt","w+");
	int opcion = 0;
	while(ciclo){
		printf("Escoge una opcion (1/2/3)");
		printf("\n1) Ver propiedades por zona");
		printf("\n2) Ver propiedades por superficie");
		printf("\n3) Agregar propiedades al catalogo\n");
		scanf("%d",&opcion);
		switch(opcion){
			case 1:
				zonas(casas);
				break;
			case 2:
				superficie(casas);
				break;
			case 3:
				agregar(casas);
				break;
			default:
				printf("Opción no disponible 7n7 maldito pseudohacker");
				break;
		}
		printf("\nDeseas hacer mas cosas? 1:Si/0:No");
		scanf("%d",&ciclo);
	}
	fclose(archivo);
	printf("Bye");
}