Le code source d´un jeux a la pac man snake si tu veut regarde rien que pour sa le code
/* This will show the new sprite animation functions !! Yay !
Thanks to
http://www.reinerstileset.4players.de/englisch.htm and Arog for the sprite ;)
// Includes, only one sprite
- include <PA9.h>
// PAGfxConverter Include
- include "gfx/all_gfx.c"
- include "gfx/all_gfx.h"
s16 framecount; //Frame count...
// Main function
int main(void) {
int x1 = 200,y1 = 10,x2 = 70,y2 = 10;
// PAlib init
PA_Init();
PA_InitVBL();
PA_InitText(1, 0);
PA_InitText(0, 0);
PA_LoadTiledBg(0, // screen
3, // background number (0-3)
bg); // Background name, used by PAGfx...
PA_LoadTiledBg(0, 0, bg);
// Load the sprite palette,
PA_LoadSpritePal(0, // Screen
0, // Palette number
(void*)sprite0_Pal); // Palette name
// Here, we´ll load a few similar sprites sprite
to animate... at different speed
PA_CreateSprite(0, 0,(void*)red_Sprite, OBJ_SIZE_32X32,1, 0, 0, 64);
PA_CreateSprite(0, 1,(void*)red_Sprite, OBJ_SIZE_32X32,1, 0, 0, 64);
while(1)
{
if(Stylus.Held)
{
x1 = Stylus.X-16;
y1 = Stylus.Y-16;
}
x1 += Pad.Held.Right - Pad.Held.Left;
y1 += Pad.Held.Down - Pad.Held.Up;
if(x1 > x2-20 && x1 < x2+20 && y1 > y2-20 && y1 < y2 + 20)
{
x2 = PA_RandMax(256-32);
y2 = PA_RandMax(192-32);
}
PA_SetSpriteXY(0, 0, x1, y1);
PA_SetSpriteXY(0, 1, x2, y2);
PA_WaitForVBL();
if(x1<-10 || x1 > 256 + 10 || y1 < -10 || y1 > 192 + 10)
break;
}
PA_OutputSimpleText(1,0,0,"perdu");
while(1)
{
PA_WaitForVBL();
}
return 0;
}
C´est en 1d un fond qui defile rien tu imagine zelda oot ?!