Hello everyone, im using Dragonfire sdk to develop 15 puzzle Game.
i'm storing the images of the puzzle boxes in an integer array, but when i try to display the images of boxes, red box appears on the screen instead of the the original image which means the image is not loaded (or indirectly the image doesn't exist).. the background is loaded properly..
heres the code please help
#include "DragonFireSDK.h"
#define MAXROWS 4
#define MAXCOLS 4
int boxes[15] = { ImageAdd("Assets/1.png"),
ImageAdd("Assets/1.png"),
ImageAdd("Assets/3.png"),
ImageAdd("Assets/4.png"),
ImageAdd("Assets/5.png"),
ImageAdd("Assets/6.png"),
ImageAdd("Assets/7.png"),
ImageAdd("Assets/8.png"),
ImageAdd("Assets/9.png"),
ImageAdd("Assets/10.png"),
ImageAdd("Assets/11.png"),
ImageAdd("Assets/12.png"),
ImageAdd("Assets/13.png"),
ImageAdd("Assets/14.png"),
ImageAdd("Assets/15.png")
};
struct board {
int grid[MAXROWS][MAXCOLS];
int posx;
int posy;
int image;
int view;
} base;
struct box {
int posx;
int posy;
int image;
int view;
int id;
box *up;
box *down;
box *left;
box *right;
} *head , *temp , *p ;
void InitializeBoard(){
base.image = ImageAdd("Assets/BG+F.png");
base.posx = 0;
base.posy = 0;
base.view = ViewAdd(base.image, base.posx, base.posy);
head = 0;
}
void InitializeBoxes(){
for (int count = 0; count<15 ; count++)
{
if (head == 0 && count == 0)
{
temp = new box;
temp->posx = 22 ;
temp->posy = 132 ;
temp->image = boxes[count] ;
temp->view = ViewAdd(temp->image, temp->posx, temp->posy) ;
temp->id = count ;
temp->up = 0 ;
temp->left = 0 ;
temp->right = 0 ;
temp->down = 0 ;
}
}
}
void AppMain()
{
InitializeBoard();
InitializeBoxes();
}
void OnTimer()
{
}