I don't know how much this will help...
first function loads all my images. 2nd i the app begin where I init my variables
void MainMenu::LoadAllImage()
{
iImage[1] = agk::LoadImage("Images/background.jpg");
iSprite[1] = agk::CreateSprite(iImage[1]);
agk::SetSpriteSize(iSprite[1],100.0f, 100.f);
agk::SetSpriteVisible(iSprite[1],0);
agk::FixSpriteToScreen(iSprite[1],0);
iImage[0] = agk::LoadImage("Cake/CakeGoal/goalweight1.png");
iSprite[0] = agk::CreateSprite(iImage[0]);
agk::SetSpriteSize(iSprite[0], 10,-1);
agk::SetSpritePosition(iSprite[0], 10, 10);
agk::SetSpriteVisible(iSprite[0],0);
iImage[2] = agk::LoadImage("Story/StoryboardOne.png");
iSprite[2] = agk::CreateSprite(iImage[2]);
agk::SetSpriteVisible(iSprite[2],0);
iImage[3] = agk::LoadImage("Story/StoryboardTwo.png");
iSprite[3] = agk::CreateSprite(iImage[3]);
agk::SetSpriteVisible(iSprite[3],0);
iImage[4] = agk::LoadImage("Story/StoryboardThree.png");
iSprite[4] = agk::CreateSprite(iImage[4]);
agk::SetSpriteVisible(iSprite[4],0);
iImage[5] = agk::LoadImage("Story/StoryboardFour.png");
iSprite[5] = agk::CreateSprite(iImage[5]);
agk::SetSpriteVisible(iSprite[5],0);
iImage[6] = agk::LoadImage("Story/StoryboardFive.png");
iSprite[6] = agk::CreateSprite(iImage[6]);
agk::SetSpriteVisible(iSprite[6],0);
iImage[7] = agk::LoadImage("Story/StoryboardSix.png");
iSprite[7] = agk::CreateSprite(iImage[7]);
agk::SetSpriteVisible(iSprite[7],0);
iImage[8] = agk::LoadImage("Story/StoryboardSeven.png");
iSprite[8] = agk::CreateSprite(iImage[8]);
agk::SetSpriteVisible(iSprite[8],0);
iImage[9] = agk::LoadImage("Story/StoryboardEight.png");
iSprite[9] = agk::CreateSprite(iImage[9]);
agk::SetSpriteVisible(iSprite[9],0);
iImage[10] = agk::LoadImage("Cake/CakeGoal/startweight.png");
iSprite[10] = agk::CreateSprite(iImage[10]);
agk::SetSpriteVisible(iSprite[10], 0);
iImage[11] = agk::LoadImage("Cake/CakeGoal/goalweight1.png");
iSprite[11] = agk::CreateSprite(iImage[11]);
agk::SetSpriteVisible(iSprite[11], 0);
iImage[12] = agk::LoadImage("Cake/CakeGoal/goalweight2.png");
iSprite[12] = agk::CreateSprite(iImage[12]);
agk::SetSpriteVisible(iSprite[12], 0);
iImageCalendar[0] = agk::LoadImage("Images/Calendar/dec2010.png");
iSpriteCalendar[0] = agk::CreateSprite(iImageCalendar[0]);
agk::SetSpriteSize(iSpriteCalendar[0], 15.0f, -1);
agk::SetSpritePosition(iSpriteCalendar[0],5.0f,3.0f);
agk::SetSpriteDepth(iSpriteCalendar[0], 9);
agk::SetSpriteVisible(iSpriteCalendar[0], 0);
iImageCalendar[1] = agk::LoadImage("Images/Calendar/jan2011.png");
iSpriteCalendar[1] = agk::CreateSprite(iImageCalendar[1]);
agk::SetSpriteSize(iSpriteCalendar[1], 15.0f, -1.0f);
agk::SetSpritePosition(iSpriteCalendar[1], 25.0f, 3.0f);
agk::SetSpriteDepth(iSpriteCalendar[1], 9);
agk::SetSpriteVisible(iSpriteCalendar[1], 0);
iImageCalendar[2] = agk::LoadImage("Images/Calendar/feb2011.png");
iSpriteCalendar[2] = agk::CreateSprite(iImageCalendar[2]);
agk::SetSpriteSize(iSpriteCalendar[2], 15.0f, -1.0f);
agk::SetSpritePosition(iSpriteCalendar[2], 45.0f, 3.0f);
agk::SetSpriteDepth(iSpriteCalendar[2], 9);
agk::SetSpriteVisible(iSpriteCalendar[2], 0);
iImageCalendar[3] = agk::LoadImage("Images/Calendar/march2011.png");
iSpriteCalendar[3] = agk::CreateSprite(iImageCalendar[3]);
agk::SetSpriteSize(iSpriteCalendar[3], 15.0f, -1.0f);
agk::SetSpritePosition(iSpriteCalendar[3], 65.0f, 3.0f);
agk::SetSpriteDepth(iSpriteCalendar[3], 9);
agk::SetSpriteVisible(iSpriteCalendar[3], 0);
iImageCalendar[4] = agk::LoadImage("Images/Calendar/apr2011.png");
iSpriteCalendar[4] = agk::CreateSprite(iImageCalendar[4]);
agk::SetSpriteSize(iSpriteCalendar[4], 15.0f, -1.0f);
agk::SetSpritePosition(iSpriteCalendar[4], 85.0f, 3.0f);
agk::SetSpriteDepth(iSpriteCalendar[4], 9);
agk::SetSpriteVisible(iSpriteCalendar[4], 0);
iImageWorldMap1 = agk::LoadImage("Images/Calendar/kitchen.png");
backgroundImage = agk::LoadImage("Images/bedroom.png");
bathroomImage = agk::LoadImage("Images/bathroom.png");
streetImage = agk::LoadImage("Images/testlevelright.png");
//agk::SetOrientationAllowed(0,0,1,0);
agk::SetClearColor(0,100,50);
}
void app::Begin( void )
{
//Set core/device data
width = agk::GetDeviceWidth ( );
height = agk::GetDeviceHeight ( );
orientation = agk::GetOrientation ( );
platform = agk::GetDeviceName ( );
//agk::SetVirtualResolution ( 100, 100);
//agk::SetOrientationAllowed(0,0,1,0);
//agk::SetDisplayAspect( 4/3 );
agk::SetPhysicsDebugOn();
//Read in data from score files
agk::OpenToRead(1, "Files/Score.txt");
while (agk::FileEOF(1) != 1) {
levelScore[iFile] = agk::Val(agk::ReadLine(1));
iFile++;
}
agk::CloseFile(1);
//read data from workout
agk::OpenToRead(2, "Files/workout.txt");
workoutNumber = agk::Val(agk::ReadLine(2));
agk::CloseFile(2);
//Load Menus
menuClass.LoadAllImage();
menuClass.CreateMenu();
//Sound
sound = agk::LoadSound ( "countdown.wav" );
victorySound = agk::LoadSound( "Sounds/victorysound.wav" );
errorSound = agk::LoadSound( "Sounds/errorsound.wav" ) ;
//Music
titleMusic = agk::LoadMusic("Music/titlemusic.mp3");
gameplayMusic = agk::LoadMusic("Music/gamePlay.mp3");
agk::PlayMusic(titleMusic,1);
}