Code: Select all
int levelData[16][16] = {asdf,adsf,asdf,asdf,etc,etc};
void drawLevel()
for(int x = 0; x < 17; x++){
for(int y = 0; y < 17; y++){
int sprite = getNextFreeID();
dbSprite(sprite,y*32,x*32,levelData[x][y]);
dbShowSprite(sprite);
}
}
}
void eraseLevel(){
for(int i = 1; i < 500; i++){
if(dbSpriteExist(i)){
dbDeleteSprite(i);
}else{
return;
}
}
}
So I am passing it in the drawLevel() function. It's a 16*16 map, and It's made up of ALL 1's.(I checked using the step debugger). Now, the code for the drawLevel() function is:
Code: Select all
void drawLevel(int (&arrayz)[16][16]){
for(int x = 0; x < 17; x++){
for(int y = 0; y < 17; y++){
int sprite = getNextFreeID();
dbSprite(sprite,y*32,x*32,arrayz[x][y]);
dbShowSprite(sprite);
}
}
}
Am I doing something wrong? It's like drawing 9 and a half rows of sprites, and when I move my selector to the edge(column 1 or column 16) it draws another cursor on the other side...