//================================================ //ゲームオーバー処理 //================================================ void DrawGameOver(void) { bgm[BGM_MAIN].StopSound(); bgm[BGM_BOSS].StopSound(); menu.Move(2); menu.CalcFontSprPos(200, 200, Menu5, 2); menu.GameOverSelect(&g_GameMode); /*シーン開始*/ if(Luna3D::BeginScene() ) { Luna3D::SetBlendingType(BLEND_NORMAL); window.DrawFont(200, 100, "Game Over"); menu.DrawFontSpr(Menu5, 2); menu.DrawCursor(); menu.Rendering(); /*シーン終了*/ Luna3D::EndScene(); } }
//================================================ //会話画面描画 //================================================ void Conversation() { window.IsDisp = TRUE; frame.IsDisp = TRUE; for(int i = 0;i < BULLET_MAX;i++) { if(player.bullet.Flag[i]) { player.bullet.Flag[i] = FALSE; } } player.Draw(); boss.Draw(); boss.Dead(&g_GameMode); if(Luna::GetSyncCounter() % 20 == 0) { boss.animcounter++; } camera.Update(); if(Luna3D::BeginScene() ) { Luna3D::SetBlendingType(BLEND_NORMAL); /*レンダリング*/ Luna3D::SetRenderState(D3DRS_FOGENABLE, TRUE); /*レンダリング*/ model.Rendering(); Luna3D::SetRenderState(D3DRS_FOGENABLE, FALSE); player.Rendering(); boss.Rendering(); frame.DrawTexture(); window.DrawTexture(); window.ScriptFaceData(); window.ScriptTreat(&g_GameMode); window.RenderingFont(); score.DrawFont(g_Score); Luna3D::EndScene(); } }
//================================================ //ゲームクリア処理 //================================================ void DrawGameClear() { bgm[BGM_BOSS].StopSound(); window.IsDisp = TRUE; /*シーン開始*/ if(Luna3D::BeginScene() ) { Luna3D::SetBlendingType(BLEND_NORMAL); window.DrawFont(200, 100, "GAME CLEAR"); window.DrawTexture(); window.ScriptTreat(&g_GameMode); window.RenderingFont(); /*シーン終了*/ Luna3D::EndScene(); } }
//================================================ //ゲームメイン画面描画 //================================================ void DrawMain(void) { frame.IsDisp = TRUE; /*当たり判定領域設定*/ SetHitRect(); g_Second++; if(!player.IsStop) { g_gamecounter++; } //------------------------------------------ //アニメーション処理 //------------------------------------------ if(g_Second % 20 == 0) { player.animcounter++; if(!player.IsStop) { for(int i = 0;i < ENEMY_NUM;i++) { enemy[i].animcounter++; } boss.animcounter++; } } if(g_Second % 5 == 0) { if(!player.IsStop) { for(int i = 0;i < SKULL_NUM;i++) { boss.skull[i].animcounter++; } for(int i = 0;i < KNIFE_NUM;i++) { boss.knife[i].animcounter++; } } } /*ショット処理*/ player.Shoot(); /*当たり判定チェック*/ CheckHitRect(); //---------------------------------------- //移動 //---------------------------------------- player.Move(); /*敵の移動処理*/ if(!player.IsStop) { EnemyMove(); EnemyShoot(); } /*ボスの移動処理*/ if(!player.IsStop) { BossMove(); } /*移動範囲補正*/ MoveAdjust(); player.UseGauge(); //if(player.IsUseSpecial) //{ // if(LunaPad::GetState(0, PAD_STATE_PUSH, PAD_BUTTON_03) ) // { // player.IsUseSpecial = FALSE; // } //} //----------------------------------------------------- //化身状態 //----------------------------------------------------- /*ポーズ*/ if(LunaPad::GetState(0, PAD_STATE_PUSH, PAD_BUTTON_05) ) { g_GameMode = SCENE_PAUSE; } /*カメラ更新*/ if(!player.IsStop) { camera.Update(); } model.Translation(); /*キャラクタ変更*/ player.UseCharaChange(); /*待機ライフ回復*/ if(Luna::GetSyncCounter() % 20 == 0) { player.Recoverlife(); } /*ゲームオーバー処理*/ if(player.IsDead) { g_GameMode = SCENE_GAMEOVER; } /*ボス死亡処理*/ boss.Dead(&g_GameMode); player.Draw(); //---------------------------------- //シーン開始 //---------------------------------- if ( Luna3D::BeginScene() ) { /*レンダリング*/ Luna3D::SetRenderState(D3DRS_FOGENABLE, TRUE); model.Rendering(); if(player.IsStop) { screen.IsDisp = TRUE; Luna3D::SetBlendingType(BLEND_REVERSE); screen.DrawTexture(); Luna3D::SetBlendingType(BLEND_NORMAL); } Luna3D::SetRenderState(D3DRS_FOGENABLE, FALSE); Luna3D::SetFilterEnable(TRUE); /*敵出現ポイント*/ EnemyPoint(); frame.DrawTexture(); player.Rendering(); score.DrawFont(g_Score); boss.Rendering(); // シーン終了 Luna3D::EndScene(); } }
//================================================ //キャラクターセレクト画面描画 //================================================ void DrawCharaSelect(void) { int LEFT = 200; int TOP = 100; int MOVE = 50; window.IsDisp = TRUE; /*シーン開始*/ if(Luna3D::BeginScene() ) { Luna3D::SetBlendingType(BLEND_NORMAL); if(++g_Second % 20 == 0) { player.animcounter++; } window.DrawTexture(); player.Draw(F(LEFT), F(TOP), player.first); player.Draw(F(LEFT), F(TOP+MOVE), player.second); player.Draw(F(LEFT), F(TOP+2*MOVE), player.third); switch(menu.Scene) { case SCENE_FIRST: { menu.CalcCharaPos(LEFT, TOP, MOVE); window.DrawFont("キャラの順番を選んでください"); window.DrawFont(0, 50); menu.Move(3); menu.CharaSelect(&g_GameMode, &player.first, &player.second, &player.third); break; } case SCENE_SECOND: { window.DrawFont("キャラの順番を選んでください"); window.DrawFont(0, 50); menu.CalcCharaPos(LEFT, TOP, MOVE); menu.Move(3); menu.CharaSelect(&g_GameMode, &player.first, &player.second, &player.third); break; } case SCENE_THIRD: { window.DrawFont("キャラの順番を選んでください"); break; } case SCENE_END: { window.DrawFont("これでいいですか?"); menu.CalcFontSprPos(200, 400, Menu6, 2); menu.DrawFontSpr(Menu6, 2); menu.CharaSelectExit(&g_GameMode); menu.Move(2); menu.DrawCursor(); menu.Rendering(); player.Type = player.first; break; } } /*シーン終了*/ Luna3D::EndScene(); } }