|
string getstage(char *data)
{
bool flag = false;
string result = "";
for (int i=0; i<(int)strlen(data); i++) {
if (flag) {
if ((data[i] != ' ') && (data[i] != '\t')) result += data[i];
}
if (data[i] == '=') flag = true;
}
return result;
}
bool addTask(Task new_task) {
Task *t = unit;
for (int i=0; i<unit_count-1; i++) {
if (t->is_used == false) {
(*t) = new_task;
return true;
}
t++;
}
return false;
}
void execTask() {
Task *to_end = unit;
for (int i=0; i<unit_count-1; i++) {
if (to_end->is_used) to_end->action(to_end);
to_end++;
}
}
void deleteTask(Task *t) {
ZeroMemory(t, sizeof(Task));
t->is_used = false;
t->action = NULL;
}
void system(Task *t) {
if (CheckHitKey(KEY_INPUT_ESCAPE)) {
DxLib_End();
exit(0);
}
DrawString(350, 0, "終了は×をクリックせずに、Escキー", GetColor(255,255,255));
DrawString(350, 20, "Pキーで最初に戻る", GetColor(255,255,255));
DrawString(350, 40, "Zキーでショット", GetColor(255,255,255));
fps();
count++;
DrawBox(450,0,640,480,GetColor(200,200,200),1);
ScreenFlip();
wait_fanc();
ClearDrawScreen();
backscreen();
SetDrawScreen(DX_SCREEN_BACK);
vector<Task>::iterator iter = enemykeep.begin();
static int appeared = 0;
if (appeared < enemy_count) {
while (true) {
if (appeared >= enemy_count) break;
if (GetNowHiPerformanceCount() < sequence + (enemykeep[appeared].appear * 10000)) break;
addTask(enemykeep[appeared]);
// char cbuf[100];
// itoa(enemykeep[appeared].appear, cbuf, 10);
// MessageBox(NULL , TEXT(cbuf), TEXT("デバッグメッセージ") , MB_OK | MB_ICONINFORMATION);
flag++;
appeared++;
sequence = GetNowHiPerformanceCount();
}
}
}
|
|