top of page

Telesketch para NDS

  • Foto del escritor: Samir Ramirez
    Samir Ramirez
  • 17 jun 2009
  • 1 Min. de lectura

He implementado usando Palib un sencillo telesketch para la NDS. El telesketch se puede descargar desde aquí. También puedes descargarte el código fuente (aquí) por si te interesa. Este código (el correspondiente al archivo main.c) es el siguiente:

// Includes #include // Include for PA_Lib

// PAGfx Include #include “gfx/all_gfx.c” #include “gfx/all_gfx.h”

s32 xcor = 8; //x0, y0 punto inicial y x1, y1 punto final s32 ycor = 6;

s32 linea = 0; //no esta dibujando linea

void pintapuntos() { s16 i, j; for (i=0;i<25;i++) { for (j=0;j 17) { if (linea == 0) { PA_SetSpriteXY(0, 1, xcor-10-8, ycor-8); }

if (linea == 1) //hay que dibujar linea { PA_SetSpriteXY(0, 0, xcor-10-8, ycor-8); PA_Draw16bitLineEx (0, xcor, ycor, xcor-10, ycor, PA_RGB(1, 1, 1),3);

} xcor = xcor-10; }

}

if (Pad.Newpress.Right) { if (xcor 15) { if (linea == 0) { PA_SetSpriteXY(0, 1, xcor-8, ycor-8-10); } else if (linea == 1) //hay que dibujar linea { PA_SetSpriteXY(0, 0, xcor-8, ycor-8-10); PA_Draw16bitLineEx (0, xcor, ycor, xcor, ycor-10, PA_RGB(1, 1, 1),3);

} ycor = ycor-10; }

}

if (Pad.Newpress.Down) { if (ycor < 184) { if (linea == 0) { PA_SetSpriteXY(0, 1, xcor-8, ycor-8+10); }

if (linea == 1) //hay que dibujar linea { PA_SetSpriteXY(0, 0, xcor-8, ycor-8+10); PA_Draw16bitLineEx (0, xcor, ycor, xcor, ycor+10, PA_RGB(1, 1, 1),3);

} ycor = ycor+10; }

}

// si pulsamos “B” borramos la pantalla if (Pad.Newpress.B){ PA_Clear16bitBg(0); pintapuntos(); }

PA_WaitForVBL(); }

return 0; } // Fin de main

Entradas recientes

Ver todo
Videojuegos con Tululoo GameMaker

Una explicación algo más detallada está en el blog que tenemos sobre GameMaker, del que Tululoo hereda varios elementos. #tululoo

 
 
 

Kommentare


3025674909|

©2020 por SM-MANUFACTURING. Creada con Wix.com

bottom of page