Hey guys I just started using AppGameKit tier 2 and I ran into this problem where I can load image 1, however I believe image 2 is not being loaded. When creating my sprite for image 1 the image appears. When creating the sprite for image 2, I receive the red x. The two pictures are in the same media folder and I'm using the exact same method of calling them. I'm sure this is a easy fix but I can't seem to find the solution. I'll put a snippet of my code down below. Sorry if my code burns anybody's eyes.
app App;
ball pong;
paddle lPaddle;
paddle rPaddle;
void app::Begin(void) {
// Creating window and background
agk::SetClearColor( 0,0,0 ); // light blue
agk::SetSyncRate(60,0);
agk::SetScissor(0,0,0,0);
agk::SetOrientationAllowed(1, 1, 1, 1);
agk::SetDisplayAspect(1024/768);
// Load paddle and ball images
agk::LoadImage(0, "paddle.png");
agk::LoadImage(1, "pong.png");
}
int app::Loop (void) {
if (agk::GetOrientation() == 1 || agk::GetOrientation() == 2) {
agk::CreateText(0, "Please turn your device into landscape mode");
agk::SetTextPosition(0, 3.5, 45);
agk::SetTextColor(0, 255, 255, 255);
agk::SetTextSize(0, 3.5);
}
// If game is in landscape mode, use these parameters
if (agk::GetOrientation() == 3 || agk::GetOrientation() == 4) {
//Delete warning txt
agk:
eleteText(0);
// If Paddle doesn't exist: create
if (agk::GetSpriteExists(lPaddle.iD) == false) {
lPaddle.iD = agk::CreateSprite(0);
agk::SetSpritePosition(lPaddle.iD, -30, 50);
agk::SetSpriteSize(lPaddle.iD, lPaddle.pWidth, lPaddle.pHeight);
}
if (agk::GetSpriteExists(rPaddle.iD) == false) {
rPaddle.iD = agk::CreateSprite(0);
agk::SetSpritePosition(rPaddle.iD, 125, 50);
agk::SetSpriteSize(rPaddle.iD, rPaddle.pWidth, rPaddle.pHeight);
}
if (agk::GetSpriteExists(pong.iD) == false) {
pong.iD = agk::CreateSprite(1);
agk::SetSpritePosition(pong.iD, 50, 50);
agk::SetSpriteSize(pong.iD, pong.bWidth, pong.bHeight);
}
// Make sure app stays in landscape mode
agk::SetOrientationAllowed(0, 0, 1, 1);
}
agk::Sync();