protected override IEnumerable <bool> E_Draw() { double x1; double x2; if (this.FacingLeft) { x1 = DDGround.ICamera.X; x2 = this.X; } else { x1 = this.X; x2 = DDGround.ICamera.X + DDConsts.Screen_W; } double y1 = this.Y - 2.0; double y2 = this.Y + 2.0; if (x2 < x1 + 2.0) { goto endFunc; } DDDraw.SetAlpha(0.2 + 0.1 * Math.Sin(DDEngine.ProcFrame / 2.0)); DDDraw.SetBright(0.0, 1.0, 1.0); DDDraw.DrawRect_LTRB( Ground.I.Picture.WhiteBox, x1 - DDGround.ICamera.X, y1 - DDGround.ICamera.Y, x2 - DDGround.ICamera.X, y2 - DDGround.ICamera.Y ); DDDraw.Reset(); if (DDEngine.ProcFrame % 5 == 0) // 間隔適当 { this.Crash = DDCrashUtils.Rect(D4Rect.LTRB(x1, y1, x2, y2)); } // 1回だけ true を返して1フレームだけ生存する必要がある。 // -- 当たり判定時に、自弾リストに this が無いと this.Crash は参照されない。 // yield return(true); // 1フレームで消滅する。 endFunc: ; //yield break; }
private static bool TitleDDStartConfirm() { bool ret = false; P_TitleBackWDest = DDConsts.Screen_W; DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == 1) { int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 280, 370, 320)) == false) // はい { ret = true; break; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(520, 280, 690, 320)) == false) // いいえ { break; } } DrawWall(); DrawTitleBack(); PrintByFont.SetPrint(); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(" セーブデータを消去します。よろしいですか?"); PrintByFont.Print(""); PrintByFont.Print(" は い い い え"); DDEngine.EachFrame(); } return(ret); }
protected override IEnumerable <bool> E_Draw() { RippleEffect.Add_波紋(this.X, this.Y, 60); RippleEffect.Add_波紋(this.X, this.Y, 120); RippleEffect.Add_波紋(this.X, this.Y, 180); RippleEffect.Add_波紋(this.X, this.Y, 360); for (int frame = 0; frame < GameConsts.PLAYER_BOMB_FRAME_MAX + 60; frame++) { this.Crash = DDCrashUtils.Rect(D4Rect.LTRB( 0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H )); yield return(true); } }
private static void TitleConfigResetPlayData() { DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == 1) { int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 280, 370, 320)) == false) // はい { // TODO SE // TODO reset play data SaveData.HasSaveData = false; // セーブデータもリセットする必要あり。 break; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(520, 280, 690, 320)) == false) // いいえ { break; } } DrawWall(); DrawTitleBack(); PrintByFont.SetPrint(); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(""); PrintByFont.Print(" プレイデータを消去します。よろしいですか?"); PrintByFont.Print(""); PrintByFont.Print(" は い い い え"); DDEngine.EachFrame(); } }
protected override IEnumerable <bool> E_Draw() { #if true foreach (DDScene scene in DDSceneUtils.Create(60)) { this.Crash = DDCrashUtils.Rect(D4Rect.LTRB( 0, DDUtils.AToBRate(GameConsts.FIELD_H - 30.0, -30.0, scene.Rate), GameConsts.FIELD_W, GameConsts.FIELD_H )); yield return(true); } #else // シンプル for (int c = 0; c < 10; c++) { this.Crash = DDCrashUtils.Rect(new D4Rect(0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H)); yield return(true); } #endif }
private DDCrash GetTabTitleCrash_拡張設定() { return(DDCrashUtils.Rect(D4Rect.LTRB(550, 50, 1050, 150))); }
private static void TitleDDStart2() { WallBokashiRateDest = 0.0; WallZRateDest = 1.02; P_TitleBackWDest = 0; const int TGS_BACK_X = 830; const int TGS_BACK_Y = 460; double selRateBack = 0.0; DDEngine.FreezeInput(); for (; ;) { DrawWall(); DrawTitleBack(); DDDraw.DrawBegin(Ground.I.Picture.TitleBtnBack, TGS_BACK_X, TGS_BACK_Y); DDDraw.DrawZoom(1.0 + selRateBack * 0.15); DDDraw.DrawEnd(); NamedCrashMgr.AddLastDrawedCrash("BACK"); // <---- 描画 DDMouse.UpdatePos(); string pointingName = NamedCrashMgr.GetName(DDMouse.X, DDMouse.Y); if (pointingName == "BACK") { DDUtils.Approach(ref selRateBack, 1.0, 0.85); } else { DDUtils.Approach(ref selRateBack, 0.0, 0.93); } DDEngine.EachFrame(); // ★★★ EachFrame if (DDMouse.L.GetInput() == 1) { if (pointingName == "BACK") { break; } int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(330, 90, 640, 360)) == false) // 入口 { SaveData.HasSaveData = true; // kari using (Game game = new Game()) { game.Room = new Room0001(); game.Perform(); } // TODO TitleMain()まで戻るべき } } } }
private static void TitleConfig() { P_TitleBackWDest = DDConsts.Screen_W; DDEngine.FreezeInput(); for (; ;) { DDMouse.UpdatePos(); if (DDUtils.IsPound(DDMouse.L.GetInput())) { int x = DDMouse.X; int y = DDMouse.Y; if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 120, 470, 160)) == false) // [960x540] { DDMain.SetScreenSize(960, 540); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(530, 120, 800, 160)) == false) // [1440x810] { DDMain.SetScreenSize(1440, 810); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 160, 470, 200)) == false) // [1920x1080] { DDMain.SetScreenSize(1920, 1080); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(530, 160, 800, 200)) == false) // [フルスクリーン] { int w = DDGround.MonitorRect.W; int h = (DDConsts.Screen_H * DDGround.MonitorRect.W) / DDConsts.Screen_W; if (DDGround.MonitorRect.H < h) { h = DDGround.MonitorRect.H; w = (DDConsts.Screen_W * DDGround.MonitorRect.H) / DDConsts.Screen_H; if (DDGround.MonitorRect.W < w) { throw new DDError(); } } DDMain.SetScreenSize(DDGround.MonitorRect.W, DDGround.MonitorRect.H); DDGround.RealScreenDraw_L = (DDGround.MonitorRect.W - w) / 2; DDGround.RealScreenDraw_T = (DDGround.MonitorRect.H - h) / 2; DDGround.RealScreenDraw_W = w; DDGround.RealScreenDraw_H = h; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(400, 240, 530, 280)) == false) { DDGround.MusicVolume += 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(550, 240, 690, 280)) == false) { DDGround.MusicVolume -= 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(700, 240, 900, 280)) == false) { DDGround.MusicVolume = DDConsts.DefaultVolume; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(400, 320, 530, 360)) == false) { DDGround.SEVolume += 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(550, 320, 690, 360)) == false) { DDGround.SEVolume -= 0.01; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(700, 320, 900, 360)) == false) { DDGround.SEVolume = DDConsts.DefaultVolume; } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(270, 400, 600, 440)) == false) { TitleConfigResetPlayData(); } else if (DDUtils.IsOut(new D2Point(x, y), D4Rect.LTRB(830, 480, 930, 520)) == false) { break; } DDGround.MusicVolume = DoubleTools.ToRange(DDGround.MusicVolume, 0.0, 1.0); DDGround.SEVolume = DoubleTools.ToRange(DDGround.SEVolume, 0.0, 1.0); } DrawWall(); DrawTitleBack(); PrintByFont.SetPrint(); PrintByFont.Print(""); PrintByFont.Print(" 設定"); PrintByFont.Print(""); PrintByFont.Print(" 画面サイズ [960x540] [1440x810]"); PrintByFont.Print(" [1920x1080] [フルスクリーン]"); PrintByFont.Print(""); PrintByFont.Print(string.Format(" BGM音量 {0:F2} [上げる] [下げる] [デフォルト]", DDGround.MusicVolume)); PrintByFont.Print(""); PrintByFont.Print(string.Format(" SE音量 {0:F2} [上げる] [下げる] [デフォルト]", DDGround.SEVolume)); PrintByFont.Print(""); PrintByFont.Print(" プレイデータリセット"); PrintByFont.Print(""); PrintByFont.Print(" [戻る]"); DDEngine.EachFrame(); } }