heres my code
Code: Select all
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <pspcallbacks.h>
#include "graphics.h"
PSP_MODULE_INFO("sprite",0,1,1);
Image*llyod[8];
int main(){
initGraphics();
SetupCallbacks();
SceCtrlData pad;
int attackonoff = 0;
int framecounter = 0;
llyod[0] = loadImage("stand.png");
llyod[1] = loadImage("attack1.png");
llyod[2] = loadImage("attack2.png");
llyod[3] = loadImage("attack3.png");
llyod[4] = loadImage("attack4.png");
llyod[5] = loadImage("attack5.png");
llyod[6] = loadImage("attack6.png");
llyod[7] = loadImage("attack7.png");
while(1){
sceCtrlReadBufferPositive(&pad,1);
if(pad.Buttons & PSP_CTRL_CROSS){
attackonoff += 1;
if(attackonoff == 2){
attackonoff = 1;
}
framecounter++;
if(framecounter >= 7){
framecounter = 0;
attackonoff = 0;
}
}
blitAlphaImageToScreen(0,0,75,72,llyod[framecounter],100,100);
sceDisplayWaitVblankStart();
flipScreen();
}
freeImage(llyod[0]);
freeImage(llyod[1]);
freeImage(llyod[2]);
freeImage(llyod[3]);
freeImage(llyod[4]);
freeImage(llyod[5]);
freeImage(llyod[6]);
freeImage(llyod[7]);
sceKernelSleepThread();
return 0;
}