Well the arrays didn't work, just gave me errors so I tried another way, still doesnt change!!!!
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspiofilemgr.h>
#include <pspgu.h>
#include <png.h>
#include <stdlib.h>
#include <string.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include <psppower.h>
#include <psprtc.h>
extern "C"
{
#include "graphics.h"
}
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
PSP_MODULE_INFO("MailasProduct", 0, 1, 1);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
//GLOBAL VARIABLES
int main(void) {
SetupCallbacks();
initGraphics();
SceCtrlData pad, lastpad;
sceCtrlReadBufferPositive(&lastpad, 1);
int MegaX = 27;
int MegaY = 136;
int ProtoX = 427;
int ProtoY = 136;
int megaPelX = 27;
int shoot = 0;
int currentBack = 1;
Image* MegaImage;
MegaImage = loadImage("./Images/M_Plat.png");
Image* ProtoImage;
ProtoImage = loadImage("./Images/P_Plat.png");
Image* PelletImage;
PelletImage = loadImage("./Images/pellet.png");
Image* Background = loadImage("./Images/Backgrounds/Back1.png");
while(1) {
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_RIGHT)
{
shoot=1;
}
if(shoot==1) {
megaPelX+=1;
blitAlphaImageToScreen(0, 0, 8, 6, PelletImage, megaPelX, MegaY); }
if(MegaY > (272 - 26))
{
MegaY = (272 - 26);
}
if(MegaY < 0)
{
MegaY = 0;
}
if(ProtoY > (272 - 26))
{
ProtoY = (272 - 26);
}
if(ProtoY < 0)
{
ProtoY = 0;
}
if((pad.Buttons & PSP_CTRL_RTRIGGER) && (currentBack == 1))
{
Background = loadImage("./Images/Backgrounds/Back2.png");
currentBack = currentBack+1;
}
if((pad.Buttons & PSP_CTRL_RTRIGGER) && (currentBack == 2))
{
Background = loadImage("./Images/Backgrounds/Back3.png");
currentBack = currentBack+1;
}
if((pad.Buttons & PSP_CTRL_RTRIGGER) && (currentBack == 3))
{
Background = loadImage("./Images/Backgrounds/Back1.png");
currentBack = 1;
}
if(pad.Buttons & PSP_CTRL_UP)
{
MegaY-=2;
}
if(pad.Buttons & PSP_CTRL_DOWN)
{
MegaY+=2;
}
if(pad.Buttons & PSP_CTRL_TRIANGLE)
{
ProtoY-=2;
}
if(pad.Buttons & PSP_CTRL_CROSS)
{
ProtoY+=2;
}
blitAlphaImageToScreen(0, 0, 480, 272, Background, 0, 0);
blitAlphaImageToScreen(0, 0, 33, 26, MegaImage, MegaX, MegaY);
blitAlphaImageToScreen(0, 0, 24, 25, ProtoImage, ProtoX, ProtoY);
sceDisplayWaitVblankStart();
flipScreen();
}
return 0;
}
What ever I do it just wont change!