DXライブラリでシューティングゲームを作成しています。
マップデータを使って複数のキャラクターを複数表示させる事が出来ません。
char mapdata[YHMAX][XWMAX+1]={
/*00*/{'0','0','0','0','0','0','1','1','1','1'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'1','1','1','1','1','1','1','1','1','1'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*01*/{'0','0','0','0','0','0','0','0','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*02*/{'0','0','0','0','0','0','0','0','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*03*/{'0','0','0','0','0','0','0','0','A','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*04*/{'0','0','0','0','0','0','0','0','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*05*/{'0','0','0','0','0','0','0','0','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*06*/{'0','0','0','0','0','0','0','A','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*07*/{'0','0','0','0','0','0','0','0','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*08*/{'0','0','0','0','0','0','0','0','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*09*/{'0','0','0','0','0','0','0','0','0','0'/*10*/,'0','0','0','0','0','0','0','0','0','0'/*20*/,'0','0','0','0','0','0','0','0','0','0'/*30*/,'0','0','0','0','0','0','0','0','0','0'/*40*/,'0','0','0','0','0','0','0','0','0','0'/*50*/,'0','0','0','0','0','0','0','0','0','0'/*60*/,'0','0','0','0','0','0','0','0','0','0'/*70*/,'0','0','0','0','0','0','0','0','0','0'/*80*/},
/*10*/{'0','0','0','0','0','0','0','0','0','0'/*11*/,'0','0','0','0','0','0','0','0','0','0'/*21*/,'0','0','0','0','0','0','0','0','0','0'/*31*/,'0','0','0','0','0','0','0','0','0','0'/*41*/,'0','0','0','0','0','0','0','0','0','0'/*51*/,'0','0','0','0','0','0','0','0','0','0'/*61*/,'0','0','0','0','0','0','0','0','0','0'/*71*/,'0','0','0','0','0','0','0','0','0','0'/*81*/},
/*11*/{'0','0','0','0','0','0','0','0','0','0'/*11*/,'0','0','0','0','0','0','0','0','0','0'/*21*/,'0','0','0','0','0','0','0','0','0','0'/*31*/,'0','0','0','0','0','0','0','0','0','0'/*41*/,'0','0','0','0','0','0','0','0','0','0'/*51*/,'0','0','0','0','0','0','0','0','0','0'/*61*/,'0','0','0','0','0','0','0','0','0','0'/*71*/,'0','0','0','0','0','0','0','0','0','0'/*81*/},
/*12*/{'0','0','0','0','0','0','0','0','0','0'/*11*/,'0','0','0','0','0','0','0','0','0','0'/*21*/,'0','0','0','0','0','0','0','0','0','0'/*31*/,'0','0','0','0','0','0','0','0','0','0'/*41*/,'0','0','0','0','0','0','0','0','0','0'/*51*/,'0','0','0','0','0','0','0','0','0','0'/*61*/,'0','0','0','0','0','0','0','0','0','0'/*71*/,'0','0','0','0','0','0','0','0','0','0'/*81*/},
/*13*/{'0','0','0','0','0','0','0','0','0','0'/*11*/,'0','0','0','0','0','0','0','0','0','0'/*21*/,'0','0','0','0','0','0','0','0','0','0'/*31*/,'0','0','0','0','0','0','0','0','0','0'/*41*/,'0','0','0','0','0','0','0','0','0','0'/*51*/,'0','0','0','0','0','0','0','0','0','0'/*61*/,'0','0','0','0','0','0','0','0','0','0'/*71*/,'0','0','0','0','0','0','0','0','0','0'/*81*/},
/*14*/{'0','0','0','0','0','0','1','1','1','1'/*11*/,'0','0','0','0','0','0','0','0','0','0'/*21*/,'1','1','1','1','1','1','1','1','1','1'/*31*/,'0','0','0','0','0','0','0','0','0','0'/*41*/,'0','0','0','0','0','0','0','0','0','0'/*51*/,'0','0','0','0','0','0','0','0','0','0'/*61*/,'0','0','0','0','0','0','0','0','0','0'/*71*/,'0','0','0','0','0','0','0','0','0','0'/*81*/}
};
//●各キャラクターのデータの初期化
void CharaInit() {
//for (int i = 0; i < YHMAX*XWMAX; i++) {
for (int y = 0; y < YHMAX; y++) {
for (int x = 0; x < XWMAX + 1; x++) {
char i = mapdata[y][x];
ch.num[i].x=(float)x*32;
ch.num[i].y = (float)y * 32;
switch (i) {
case '1':
//ch.num[i].x = (float)x * 32;
//ch.num[i].y = (float)y * 32;
ch.num[i].body = 100;
break;
case 'A':
//ch.num[i].x = (float)x * 32;
//ch.num[i].y = (float)y * 32;
ch.num[i].anipat = 2;
ch.num[i].body = 1;
break;
} //switch(c)の最後
mapdata[y][x] = '0';
} //for(int x=0;x<XWMAX+1;x++)の最後
} //for(int y=0;y<YHMAX;y++)の最後
//} //for(int i=0;i<YHMAX*XWMAX;i++)の最後
}; //void CharaInit();の最後
//●各キャラクターの移動処理
void CharaMove() {
for (int i = 0; i < YHMAX*XWMAX; i++) {
switch (i) {
case '1':
DrawGraph(ch.num[i].x, ch.num[i].y, im.kabe01, TRUE);
break;
case 'A':
int Aa = anicounter / 20 % ch.num[i].anipat;
DrawGraph(ch.num[i].x, ch.num[i].y, im.teki0A[Aa], TRUE);
break;
} //switch(i)の最後
ch.num[i].x = ch.num[i].x - 1;
} //for(int i=0;i<YHMAX*XWMAX;i++)の最後
} //void CharaMove();の最後
こちらのソースコードではマップデータから座標軸を取り出してスクロールさせるところは出来たのですが、とりだせたデーターは実質一つだけでした。
//for (int i = 0; i < YHMAX*XWMAX; i++) {を利用してキャラクターの種類と個数を分ける方法も試したのですが、すると今度は応答なしの状態になってしまいます。
どうすればマップデータからすべての座標軸を正常に取り出して画面に表示する事が出来るでしょうか。