protected override IEnumerable <bool> E_Draw() { // ---- 環境制御 ---- Game.I.Walls.Add(new Wall_21001()); Game.I.Walls.Add(new Wall_21002()); // ---- Func <bool> f_attack_01 = SCommon.Supplier(this.E_Attack_01()); Func <bool> f_attack_02 = SCommon.Supplier(this.E_Attack_02()); const int 画面分割_開始Frame = EnemyConsts_ルーミア.TRANS_FRAME + 180; for (int frame = 0; ; frame++) { DDUtils.Approach(ref this.X, GameConsts.FIELD_W / 2 + Math.Sin(frame / 101.0) * 20.0, 0.993); DDUtils.Approach(ref this.Y, GameConsts.FIELD_H / 2 + Math.Sin(frame / 103.0) * 20.0, 0.993); if (EnemyConsts_ルーミア.TRANS_FRAME < frame) { if (!this.Mode_02) { if (frame < 画面分割_開始Frame) { double sec = (画面分割_開始Frame - frame) / 60.0; string sSec = sec.ToString("F2"); DDGround.EL.Add(() => { DDPrint.SetPrint( GameConsts.FIELD_L + GameConsts.FIELD_W / 2 - 16, GameConsts.FIELD_T + GameConsts.FIELD_H / 2 - 8 ); DDPrint.SetBorder(new I3Color(192, 0, 0)); DDPrint.SetColor(new I3Color(255, 255, 0)); DDPrint.Print(sSec); DDPrint.Reset(); return(false); }); } else if (frame == 画面分割_開始Frame) { 画面分割_Effect.Enter(); 画面分割.Enabled = true; } } f_attack_01(); f_attack_02(); } EnemyCommon_ルーミア.PutCrash(this, frame); EnemyCommon_ルーミア.Draw(this.X, this.Y); yield return(true); } }
public static IEnumerable <bool> Message(string message, I3Color color, I3Color borderColor) { Action a_draw_message = () => { DDPrint.SetPrint(DDConsts.Screen_W / 2 - 4 * message.Length, DDConsts.Screen_H / 2 - 8); DDPrint.SetColor(color); DDPrint.SetBorder(borderColor); DDPrint.Print(message); DDPrint.Reset(); }; foreach (DDScene scene in DDSceneUtils.Create(20)) { DDDraw.SetAlpha(0.5); DDDraw.SetBright(0, 0, 0); DDDraw.DrawRect_LTRB( Ground.I.Picture.WhiteBox, 0, DDConsts.Screen_H / 2 - (10 + 40 * scene.Rate), DDConsts.Screen_W, DDConsts.Screen_H / 2 + (10 + 40 * scene.Rate) ); DDDraw.Reset(); a_draw_message(); yield return(true); } foreach (DDScene scene in DDSceneUtils.Create(180)) { DDDraw.SetAlpha(0.5); DDDraw.SetBright(0, 0, 0); DDDraw.DrawRect_LTRB( Ground.I.Picture.WhiteBox, 0, DDConsts.Screen_H / 2 - 50, DDConsts.Screen_W, DDConsts.Screen_H / 2 + 50 ); DDDraw.Reset(); a_draw_message(); yield return(true); } foreach (DDScene scene in DDSceneUtils.Create(20)) { DDDraw.SetAlpha(0.5); DDDraw.SetBright(0, 0, 0); DDDraw.DrawRect_LTRB( Ground.I.Picture.WhiteBox, 0, DDConsts.Screen_H / 2 - (10 + 40 * (1.0 - scene.Rate)), DDConsts.Screen_W, DDConsts.Screen_H / 2 + (10 + 40 * (1.0 - scene.Rate)) ); DDDraw.Reset(); a_draw_message(); yield return(true); } }
public void Perform() { DDCurtain.SetCurtain(); DDEngine.FreezeInput(); Ground.I.Music.Filed_01.Play(); long frmProcMilAvgNumer = 0L; long frmProcMilAvgDenom = 0L; int effectPerFrm = 10; int effectCount = 1; for (; ;) { if (DDInput.PAUSE.IsPound()) { break; } if (DDInput.A.IsPound()) { effectPerFrm--; } if (DDInput.B.IsPound()) { effectPerFrm++; } if (DDInput.C.IsPound()) { effectCount++; } if (DDInput.D.IsPound()) { effectCount--; } effectPerFrm = IntTools.ToRange(effectPerFrm, 1, 10); effectCount = IntTools.ToRange(effectCount, 1, 100); if (DDEngine.ProcFrame % effectPerFrm == 0) { for (int c = 0; c < effectCount; c++) { new DDCommonEffect(DDGround.GeneralResource.Dummy) { X = 400.0, Y = 300.0, Z = 0.5, XAdd2 = Math.Cos(DDEngine.ProcFrame / 100.0 + c) * 0.1, YAdd2 = Math.Sin(DDEngine.ProcFrame / 100.0 + c) * 0.1, } .Fire(); } } this.DrawWall(); // フォントのテスト DDFontUtils.DrawString_XCenter( 400, 20, "げんかいみんちょう", DDFontUtils.GetFont("源界明朝", 70, 6, true, 2) ); DDFontUtils.DrawString_XCenter( 400, 520, "りいてがき", DDFontUtils.GetFont("りいてがき筆", 50, 6, true, 2) ); frmProcMilAvgNumer += DDEngine.FrameProcessingMillis; frmProcMilAvgDenom++; double frmProcMilAvg = (double)frmProcMilAvgNumer / frmProcMilAvgDenom; if (DDEngine.ProcFrame % 100 == 0) { frmProcMilAvgNumer /= 2; frmProcMilAvgDenom /= 2; } DDDraw.SetTaskList(DDGround.EL); DDDraw.SetAlpha(0.5); DDDraw.SetBright(new I3Color(0, 0, 0)); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, 0, DDConsts.Screen_W, 16); DDDraw.Reset(); DDPrint.SetPrint(); DDPrint.SetTaskList(DDGround.EL); DDPrint.SetColor(new I3Color(255, 128, 0)); DDPrint.Print(string.Format( "FST={0},HCT={1},FPM={2},FPW={3},FPMA={4:F3}(EPF={5},EC={6},ELC={7})" , DDEngine.FrameStartTime , DDEngine.HzChaserTime , DDEngine.FrameProcessingMillis , DDEngine.FrameProcessingMillis_Worst , frmProcMilAvg , effectPerFrm , effectCount , DDGround.EL.Count )); DDPrint.Reset(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -1.0); foreach (DDScene scene in DDSceneUtils.Create(40)) { this.DrawWall(); DDEngine.EachFrame(); } DDGround.EL.Clear(); }
/// <summary> /// レイヤ表示を実行する。 /// ステージ番号: /// -- 1~9 == 各ステージ /// </summary> /// <param name="stageNo">ステージ番号</param> /// <param name="themeColor">このステージの印象的な色</param> public static void Perform(int stageNo, I3Color themeColor) { int layerNo = 10 - stageNo; DDCurtain.SetCurtain(0, -1.0); DDCurtain.SetCurtain(); using (DDSubScreen tmpScreen = new DDSubScreen(400, 200)) { foreach (DDScene scene in DDSceneUtils.Create(210)) { if (scene.Numer + 30 == scene.Denom) { DDCurtain.SetCurtain(30, -1.0); } DDCurtain.DrawCurtain(); int bure = (int)(scene.Rate * scene.Rate * 20); int xBure = DDUtils.Random.GetRange(-bure, bure); int yBure = DDUtils.Random.GetRange(-bure, bure); #if true DDFontUtils.DrawString_XCenter( DDConsts.Screen_W / 2 + xBure, DDConsts.Screen_H / 2 + yBure - 50, "LAYER " + layerNo, DDFontUtils.GetFont("03焚火-Regular", 100) ); #else using (tmpScreen.Section()) { DDPrint.SetColor(new I3Color(60, 60, 60)); DDPrint.SetBorder(new I3Color(255, 255, 255)); DDPrint.SetPrint(tmpScreen.GetSize().W / 2 - 60, tmpScreen.GetSize().H / 2 - 8); DDPrint.Print("L A Y E R : " + layerNo); DDPrint.Reset(); } DDDraw.SetMosaic(); DDDraw.DrawBegin( tmpScreen.ToPicture(), DDConsts.Screen_W / 2 + xBure, DDConsts.Screen_H / 2 + yBure ); DDDraw.DrawZoom(6.0); DDDraw.DrawEnd(); DDDraw.Reset(); #endif if (0.5 < scene.Rate) { const int c_max = 300; for (int c = (int)(scene.Rate * scene.Rate * c_max); 0 < c; c--) { double c_rate = (double)c / c_max; DDDraw.SetAlpha(scene.Rate * 0.5); //DDDraw.SetBright(new I3Color(c, c, c)); // old DDDraw.SetBright(new I3Color( (int)(themeColor.R * c_rate), (int)(themeColor.G * c_rate), (int)(themeColor.B * c_rate) )); DDDraw.DrawBegin( Ground.I.Picture.WhiteBox, DDUtils.Random.GetInt(DDConsts.Screen_W), DDUtils.Random.GetInt(DDConsts.Screen_H) ); DDDraw.DrawSetSize( DDUtils.Random.GetRange(40, (int)(400 * scene.Rate)), DDUtils.Random.GetRange(20, (int)(200 * scene.Rate)) ); DDDraw.DrawEnd(); DDDraw.Reset(); } } DDEngine.EachFrame(); } } DDCurtain.SetCurtain(0); }