メニュー画面と難易度などを選択する画面を作ったのですが、選択したものを表示する部分で、文字が重なって
しまいます。
どこがいけないのか、どのように改善すれば良いのか教えていただきたいです。
よろしくお願いします。
ソースコード
void GameStart(void)
{
while (1){
GetHitKeyStateAll(Key); // すべてのキーの状態を得る
if (ProcessMessage() == -1) break; //エラーがおきたら終了
DrawGraph(0, 0, Open, FALSE);
DrawStringToHandle(220, 80, "shooting", GetColor(255, 255, 0), FontHG48);
DrawBox(195, 250 + 25 * start_select, 490, 275 + 25 * start_select, GetColor(255, 255, 0), FALSE);
DrawStringToHandle(250, 250, "Game Start", GetColor(255, 255, 255), FontHGS24);
DrawGraph(200, 252, teki0[0], TRUE);
DrawFormatStringToHandle(250, 275, GetColor(255, 255, 255), FontHGS24, "Time : %d"
, time1);
DrawGraph(200, 277, Apple[0], TRUE);
DrawStringToHandle(250, 300, "難易度: ", GetColor(255, 255, 255), FontHGS24);
DrawFormatStringToHandle(360, 300, Lv_color, FontHG24, "%s ", Lv1);
DrawGraph(200, 302, Apple[13], TRUE);
DrawStringToHandle(250, 325, "自機:", GetColor(255, 255, 255), FontHGS24);
DrawGraph(200, 327, teki4, TRUE);
DrawGraph(430, 327, MAN[character * 2], TRUE);
if (start_counter<10)
start_counter++;
else if (Key[KEY_INPUT_DOWN] == 1){
start_counter = 0;
start_select++;
if (start_select>3)
start_select = 1;
}
else if (Key[KEY_INPUT_UP] == 1){
start_counter = 0;
start_select--;
if (start_select<1)
start_select = 3;
}
if (time_counter<10)
time_counter++;
else if (start_select == 1 && Key[KEY_INPUT_RIGHT] == 1){
time_counter = 0;
time_select++;
if (time_select>7)
time_select = 7;
}
else if (start_select == 1 && Key[KEY_INPUT_LEFT] == 1){
time_counter = 0;
time_select--;
if (time_select<1)
time_select = 1;
}
if (time_select == 0)
time1 = 10;
else if (time_select == 1)
time1 = 30;
else if (time_select == 2)
time1 = 60;
else if (time_select == 3)
time1 = 90;
else if (time_select == 4)
time1 = 120;
else if (time_select == 5)
time1 = 180;
else if (time_select == 6)
time1 = 300;
else if (time_select == 7)
time1 = 600;
if (Lv_counter<10)
Lv_counter++;
else if (start_select == 2 && Key[KEY_INPUT_RIGHT] == 1){
Lv_counter = 0;
Lv++;
if (Lv>6)
Lv = 6;
}
else if (start_select == 2 && Key[KEY_INPUT_LEFT] == 1){
Lv_counter = 0;
Lv--;
if (Lv<1)
Lv = 1;
}
if (Lv == 1){
strcpy_s(Lv1, "Very Easy");
Lv_color = GetColor(0, 255, 255);
}
if (Lv == 2){
strcpy_s(Lv1, "Easy");
Lv_color = GetColor(0, 255, 0);
}
if (Lv == 3){
strcpy_s(Lv1, "Normal");
Lv_color = GetColor(255, 255, 0);
}
if (Lv == 4){
strcpy_s(Lv1, "Hard");
Lv_color = GetColor(255, 128, 0);
}
if (Lv == 5){
strcpy_s(Lv1, "Lunatic");
Lv_color = GetColor(255, 0, 0);
}
if (Lv == 6){
strcpy_s(Lv1, "High Speed");
Lv_color = GetColor(255, 100, 255);
}
if (character_counter<10)
character_counter++;
else if (start_select == 3 && Key[KEY_INPUT_RIGHT] == 1){
character_counter = 0;
character++;
if (character>charaX - 1)
character = charaX - 1;
}
else if (start_select == 3 && Key[KEY_INPUT_LEFT] == 1){
character_counter = 0;
character--;
if (character<0)
character = 0;
}
DrawBox(105, 370, 535, 470, GetColor(0, 255, 0), FALSE);
if (start_select == 0)
DrawStringToHandle(110, 375, "SPACEKEY TO START", GetColor(255, 255, 255),
FontHGS20);
else if (start_select == 1)
DrawStringToHandle(110, 375, "制限時間の設定ができます", GetColor(255, 255, 255), FontHGS20);
else if (start_select == 2 && Lv == 1)
DrawStringToHandle(110, 375, "とても簡単", GetColor(255, 255, 255), FontHGS20);
else if (start_select == 2 && Lv == 2)
DrawStringToHandle(110, 375, "まあ簡単", GetColor(255, 255, 255),
FontHGS20);
else if (start_select == 2 && Lv == 3)
DrawStringToHandle(110, 375, "普通の難易度です", GetColor(255, 255, 255), FontHGS20);
else if (start_select == 2 && Lv == 4)
DrawStringToHandle(110, 375, "STGが得意な方向けの難易度です", GetColor(255, 255, 255), FontHGS20);
else if (start_select == 2 && Lv == 5)
DrawStringToHandle(110, 375, "STGを知り尽くした方向けの難易度です",
GetColor(255, 255, 255), FontHGS20);
else if (start_select == 2 && Lv == 6)
DrawStringToHandle(110, 375, "とても速いです", GetColor(255, 255, 255), FontHGS20);
else if (start_select == 3){
DrawStringToHandle(110, 375, "HP :", GetColor(0, 200, 255), FontHGS20);
DrawStringToHandle(110, 400, "パワー :", GetColor(255, 0, 50), FontHGS20);
DrawStringToHandle(110, 425, "スピード:", GetColor(255, 255, 0), FontHGS20);
DrawStringToHandle(110, 450, "カウント:", GetColor(0, 255, 0), FontHGS20);
for (i = 0; i<Maxhp0[character]; i++)
DrawStringToHandle(200 + 20 * i, 375, "★", GetColor(0, 200, 255), FontHGS20);
for (j = 0; j<attack0[character]; j++)
DrawStringToHandle(200 + 20 * j, 400, "★", GetColor(255, 0, 50), FontHGS20);
for (k = 0; k<speed0[character]; k++)
DrawStringToHandle(200 + 20 * k, 425, "★", GetColor(255, 255, 0), FontHGS20);
for (m = 0; m<count0[character]; m++)
DrawStringToHandle(200 + 20 * m, 450, "★", GetColor(0, 255, 0), FontHGS20);
}
ScreenFlip();
if (Key[KEY_INPUT_RETURN] == 1 || (start_select == 0 && Key[KEY_INPUT_SPACE] == 1))
break;
}
}