protected override IEnumerable <bool> E_Draw() { double xSpeed = 1.0; for (; ;) { xSpeed -= 0.1; this.X += xSpeed; if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 60.0) { this.プレイヤーがアイテムを取得した(); break; } DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X, this.Y); DDDraw.DrawRotate(DDEngine.ProcFrame / 10.0); DDDraw.DrawEnd(); DDPrint.SetPrint((int)this.X, (int)this.Y); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.PrintLine("アイテム"); DDPrint.PrintLine("効用:" + 効用_e_Names[(int)this.効用]); DDPrint.Reset(); // 当たり判定無し yield return(true); } }
private static void DrawMenu() { DDDraw.SetAlpha(0.5); DDDraw.SetBright(0.0, 0.3, 0.6); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, MenuRect.L, MenuRect.T, MenuRect.W, MenuRect.H); DDDraw.Reset(); DDPrint.SetPrint(); DDPrint.PrintLine("INPUT WALL: " + InputWallFlag); DDPrint.PrintLine("INPUT TILE: " + InputTileFlag); DDPrint.PrintLine("INPUT ENEMY: " + InputEnemyFlag); DDPrint.PrintLine("DISPLAY WALL: " + DisplayWallFlag); DDPrint.PrintLine("DISPLAY TILE: " + DisplayTileFlag); DDPrint.PrintLine("DISPLAY ENEMY: " + DisplayEnemyFlag); DDPrint.PrintLine("WALL: " + Wall); DDPrint.PrintLine("TILE: " + TileIndex + " / " + MapTileManager.GetCount()); DDPrint.PrintLine("TILE=[" + MapTileManager.GetNames()[TileIndex] + "]"); DDPrint.PrintLine("ENEMY: " + EnemyIndex + " / " + EnemyManager.GetCount()); DDPrint.PrintLine("ENEMY=[" + EnemyManager.GetNames()[EnemyIndex] + "]"); I2Point pt = Map.ToTablePoint(DDMouse.X + DDGround.ICamera.X, DDMouse.Y + DDGround.ICamera.Y); MapCell cell = Game.I.Map.GetCell(pt); DDPrint.PrintLine("CURSOR: " + pt.X + ", " + pt.Y); DDPrint.PrintLine("CURSOR WALL: " + cell.Wall); DDPrint.PrintLine("CURSOR TILE=[" + (cell.Tile == null ? "" : cell.Tile.Name) + "]"); DDPrint.PrintLine("CURSOR ENEMY=[" + (cell.EnemyLoader == null ? "" : cell.EnemyLoader.Name) + "]"); DDPrint.PrintLine(""); DDPrint.PrintLine("キー操作"); DDPrint.PrintLine("C = COPY"); DDPrint.PrintLine("S = SAVE"); }
protected override IEnumerable <bool> E_Draw() { for (; ;) { if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 30.0) // ? 十分に接近 -> 取得する。 { Game.I.Status.InventoryFlags[GameStatus.Inventory_e.取得済み_跳ねる陰陽玉] = true; break; } if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(DDEngine.ProcFrame / 30.0); DDDraw.DrawEnd(); DDPrint.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.PrintLine("跳ねる陰陽玉"); DDPrint.Reset(); // 当たり判定無し } yield return(true); } }
protected override IEnumerable <bool> E_Draw() { for (; ;) { if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 30.0) { this.プレイヤーがアイテムを取得した(); break; } if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(DDEngine.ProcFrame / 10.0); DDDraw.DrawEnd(); DDPrint.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.PrintLine("アイテム"); DDPrint.PrintLine("効用:" + 効用_e_Names[(int)this.効用]); DDPrint.Reset(); // 当たり判定無し } yield return(true); } }
protected override IEnumerable <bool> E_Draw() { for (; ;) { if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 30.0) { GameCommon.SaveGame(); break; } if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(DDEngine.ProcFrame / 30.0); DDDraw.DrawEnd(); DDPrint.SetPrint((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.PrintLine("セーブ地点"); DDPrint.Reset(); // 当たり判定無し } yield return(true); } }
private void DrawStatus() { DDPrint.SetPrint(760, 30, 20); DDPrint.SetBorder(new I3Color(100, 0, 150)); DDPrint.PrintLine("HiSCORE"); DDPrint.PrintLine(string.Format("{0,20}", Ground.I.HiScore)); DDPrint.SetBorder(new I3Color(110, 0, 140)); DDPrint.PrintLine(" SCORE"); DDPrint.PrintLine(string.Format("{0,20}", this.Score)); DDPrint.PrintLine(""); DDPrint.PrintLine(""); DDPrint.SetBorder(new I3Color(120, 0, 130)); DDPrint.PrintLine(string.Format(" PLAYER {0}", string.Join("", Enumerable.Repeat("★", this.Zanki)))); DDPrint.PrintLine(""); DDPrint.SetBorder(new I3Color(130, 0, 120)); DDPrint.PrintLine(string.Format(" BOMB {0}", string.Join("", Enumerable.Repeat("@", this.ZanBomb)))); DDPrint.PrintLine(""); DDPrint.PrintLine(""); DDPrint.PrintLine(""); DDPrint.PrintLine(""); DDPrint.SetBorder(new I3Color(150, 150, 100)); DDPrint.PrintLine(" POWER"); DDPrint.Reset(); DrawStatus_Power(); }
public override IEnumerable <bool> E_Draw() { for (; ;) { DDUtils.Approach(ref this.A, this.Ended ? 0.0 : 1.0, 0.9); DDDraw.SetAlpha(this.A); DDDraw.DrawBegin(Ground.I.Picture.MessageWindow, this.X, this.Y); DDDraw.DrawZoom_X(this.LeftSide ? 1.0 : -1.0); DDDraw.DrawZoom_Y(-1.0); DDDraw.DrawEnd(); DDDraw.Reset(); if (!this.Ended) { DDPrint.SetBorder(new I3Color(40, 0, 0)); DDPrint.SetPrint( (int)this.X - 200, (int)this.Y - 0 ); DDPrint.PrintLine(this.Messages[0]); DDPrint.PrintLine(""); DDPrint.PrintLine(this.Messages[1]); DDPrint.Reset(); } yield return(!this.Ended || 0.003 < this.A); } }
public void Perform() { DDUtils.SetMouseDispMode(false); DDEngine.FreezeInput(10); double x = DDConsts.Screen_W / 2; double y = DDConsts.Screen_H / 2; double speed = SPEED_DEF; for (; ;) { DDMouse.UpdateMove(); x += DDMouse.MoveX * speed; y += DDMouse.MoveY * speed; DDUtils.ToRange(ref x, 0, DDConsts.Screen_W - 1); DDUtils.ToRange(ref y, 0, DDConsts.Screen_H - 1); int ix = DoubleTools.ToInt(x); int iy = DoubleTools.ToInt(y); if (DDKey.IsPound(DX.KEY_INPUT_Z)) { speed += SPEED_CHANGE_STEP; } if (DDKey.IsPound(DX.KEY_INPUT_X)) { speed -= SPEED_CHANGE_STEP; } DDUtils.ToRange(ref speed, SPEED_MIN, SPEED_MAX); if (DDMouse.L.GetInput() == -1) { break; } DDCurtain.DrawCurtain(); DDPrint.SetPrint(0, 0, 24); DDPrint.PrintLine("★マウスカーソルを奪う"); DDPrint.PrintLine("X=" + x.ToString("F3")); DDPrint.PrintLine("Y=" + y.ToString("F3")); DDPrint.PrintLine("Speed=" + speed); DDPrint.PrintLine("左クリックでメニューに戻る。"); DDPrint.PrintLine("Zキー:速度上げ"); DDPrint.PrintLine("Xキー:速度下げ"); DDDraw.SetBright(new I3Color(255, 128, 0)); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, ix, iy - CROSS_WH / 2, 1, CROSS_WH); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, ix - CROSS_WH / 2, iy, CROSS_WH, 1); DDDraw.Reset(); DDEngine.EachFrame(); } DDUtils.SetMouseDispMode(true); }
public void Test01() { int index = 0; for (; ;) { if (DDInput.DIR_8.IsPound()) { index -= Consts.SCREEN_MAP_W; } if (DDInput.DIR_4.IsPound()) { index--; } if (DDInput.DIR_6.IsPound()) { index++; } if (DDInput.DIR_2.IsPound()) { index += Consts.SCREEN_MAP_W; } index += MapTileManager.GetCount(); index %= MapTileManager.GetCount(); // 描画 ... DDCurtain.DrawCurtain(); { int i = index; for (int y = 0; y < Consts.SCREEN_MAP_H; y++) { for (int x = 0; x < Consts.SCREEN_MAP_W; x++) { DDDraw.DrawSimple(MapTileManager.GetTile(MapTileManager.GetNames()[i]).Picture, x * MapTile.WH, y * MapTile.WH); i++; i %= MapTileManager.GetCount(); } } } DDPrint.SetPrint(); DDPrint.SetBorder(new I3Color(0, 64, 0)); for (int i = 0; i < 40; i++) { DDPrint.PrintLine("[" + i.ToString("D2") + "] " + MapTileManager.GetNames()[(index + i) % MapTileManager.GetCount()]); } DDPrint.Reset(); DDEngine.EachFrame(); } }
private void DrawDungeon(double xSlideRate = 0.0) { DDCurtain.DrawCurtain(); DDDraw.DrawCenter(DungeonScreen.DungScreen.ToPicture(), DDConsts.Screen_W / 2 + xSlideRate * 90.0, DDConsts.Screen_H / 2 - 150); DDDraw.DrawSimple(Ground.I.Picture.GameFrame, 0, 0); this.DistanceFromStart = DDUtils.GetDistance( this.Map.DungeonMap.StartPoint.X - this.Player.X, this.Map.DungeonMap.StartPoint.Y - this.Player.Y ); DDUtils.Approach(ref this.DistanceFromStart_Delay, this.DistanceFromStart, 0.8); DDPrint.SetPrint(100, 410, 24); DDPrint.SetBorder(new I3Color(100, 50, 150)); DDPrint.PrintLine("方角:" + "南西東北"[this.Player.Direction / 2 - 1]); DDPrint.PrintLine("スタート地点からの直線距離:" + this.DistanceFromStart_Delay.ToString("F3")); DDPrint.Reset(); }
protected override IEnumerable <bool> E_Draw() { for (; ;) { double rot = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y); rot += DDUtils.Random.Real() * 0.05; D2Point speedAdd = DDUtils.AngleToPoint(rot, 0.1); double distance = DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y); if (distance < 50.0) { speedAdd *= -300.0; } this.Speed += speedAdd; this.Speed *= 0.93; this.X += this.Speed.X; this.Y += this.Speed.Y; if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(DDEngine.ProcFrame / 10.0); DDDraw.DrawEnd(); DDPrint.SetBorder(new I3Color(64, 64, 0)); DDPrint.SetPrint( (int)this.X - DDGround.ICamera.X - 10, (int)this.Y - DDGround.ICamera.Y - 10, 20 ); DDPrint.PrintLine("敵(仮)"); DDPrint.PrintLine("[無害]"); DDPrint.PrintLine("DIST=" + distance.ToString("F3")); DDPrint.Reset(); // 当たり判定ナシ } yield return(true); } }
public void Perform() { DDEngine.FreezeInput(10); for (; ;) { DDMouse.UpdatePos(); if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(WARP_L, WARP_T, WARP_W, WARP_H)) == false) { DDMouse.X = WARP_DEST_X; DDMouse.Y = WARP_DEST_Y; DDMouse.ApplyPos(); } if (DDMouse.L.GetInput() == -1) { break; } DDCurtain.DrawCurtain(); DDPrint.SetPrint(0, 0, 24); DDPrint.PrintLine("★位置取得と位置設定"); DDPrint.PrintLine("X=" + DDMouse.X); DDPrint.PrintLine("Y=" + DDMouse.Y); DDPrint.PrintLine("左クリックでメニューに戻る。"); DDPrint.PrintLine("水色の領域にマウスカーソルを移動すると、黄色い十字にワープする。"); DDDraw.SetBright(new I3Color(0, 200, 200)); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, WARP_L, WARP_T, WARP_W, WARP_H); DDDraw.Reset(); DDDraw.SetBright(new I3Color(200, 200, 0)); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, WARP_DEST_X, WARP_DEST_Y - CROSS_WH / 2, 1, CROSS_WH); DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, WARP_DEST_X - CROSS_WH / 2, WARP_DEST_Y, CROSS_WH, 1); DDDraw.Reset(); DDEngine.EachFrame(); } }
public void Perform() { DDEngine.FreezeInput(10); for (; ;) { DDMouse.UpdatePos(); if (DDMouse.L.GetInput() == -1) { break; } DDCurtain.DrawCurtain(); DDPrint.SetPrint(0, 0, 24); DDPrint.PrintLine("★位置取得のみ"); DDPrint.PrintLine("X=" + DDMouse.X); DDPrint.PrintLine("Y=" + DDMouse.Y); DDPrint.PrintLine("左クリックでメニューに戻る。"); DDEngine.EachFrame(); } }
public void Perform() { if (DDConfig.LOG_ENABLED) // 開発・デバッグ_モードであることを表示 { #if true DDGround.EL.Keep(300, () => { DDPrint.SetPrint(20, DDConsts.Screen_H - 40, 20); DDPrint.PrintLine("デバッグモードが有効になりました。"); DDPrint.PrintLine("★これはクローズドテスト版です。仮リソース・未実装・不完全な機能を含みます。(このメッセージは数秒で消えます)"); }); #else // old nearly same int endFrame = DDEngine.ProcFrame + 300; DDGround.EL.Add(() => { int remFrame = endFrame - DDEngine.ProcFrame; DDPrint.SetPrint(60, DDConsts.Screen_H - 40, 20); DDPrint.PrintLine("デバッグモードが有効になりました。"); DDPrint.PrintLine("★これはクローズドテスト版です。仮リソース・未実装・不完全な機能を含みます。(あと " + (remFrame / 60.0).ToString("F1") + " 秒で消えます)"); return(0 < remFrame); }); #endif } foreach (DDScene scene in DDSceneUtils.Create(60)) // LiteStatusDlg を閉じるまでの遅延の分(30フレーム)延長 //foreach (DDScene scene in DDSceneUtils.Create(30)) { DDCurtain.DrawCurtain(); DDEngine.EachFrame(); } double z1 = 0.3; double z2 = 2.0; double z3 = 3.7; foreach (DDScene scene in DDSceneUtils.Create(60)) { DDCurtain.DrawCurtain(); DDDraw.SetAlpha(scene.Rate); DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(z1); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha((1.0 - scene.Rate) * 0.7); DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(0.8 + 0.5 * scene.Rate); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5); DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(z2); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3); DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(z3); DDDraw.DrawEnd(); DDDraw.Reset(); DDUtils.Approach(ref z1, 1.0, 0.9); DDUtils.Approach(ref z2, 1.0, 0.98); DDUtils.Approach(ref z3, 1.0, 0.95); DDEngine.EachFrame(); } { long endLoopTime = long.MaxValue; for (int frame = 0; ; frame++) { if (endLoopTime < DDEngine.FrameStartTime) { break; } if (frame == 1) { endLoopTime = DDEngine.FrameStartTime + 1500; DDTouch.Touch(); } DDCurtain.DrawCurtain(); DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDEngine.EachFrame(); } } foreach (DDScene scene in DDSceneUtils.Create(60)) { DDCurtain.DrawCurtain(); DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5); DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(1.0 - 0.3 * scene.Rate); DDDraw.DrawRotate(scene.Rate * -0.1); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5); DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(1.0 + 0.8 * scene.Rate); DDDraw.DrawRotate(scene.Rate * 0.1); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3); DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2 + scene.Rate * 100.0, DDConsts.Screen_H / 2); DDDraw.Reset(); DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3); DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2 + scene.Rate * 50.0); DDDraw.Reset(); DDEngine.EachFrame(); } }
private int HitBackFrame = 0; // 0 == 無効, 1~ ヒットバック中 protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { double SPEED = 2.0; double xBuru = 0.0; double yBuru = 0.0; if (1 <= this.HitBackFrame) { int frm = this.HitBackFrame - 1; if (HIT_BACK_FRAME_MAX < frm) { this.HitBackFrame = 0; goto endHitBack; } this.HitBackFrame++; // ---- double rate = (double)frm / HIT_BACK_FRAME_MAX; SPEED = 0.0; xBuru = (1.0 - rate) * 30.0 * DDUtils.Random.Real(); yBuru = (1.0 - rate) * 30.0 * DDUtils.Random.Real(); } endHitBack: switch (frame / 60 % 4) { case 0: this.X += SPEED; break; case 1: this.Y += SPEED; break; case 2: this.X -= SPEED; break; case 3: this.Y -= SPEED; break; default: throw null; // never } if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 100.0)) { if (1 <= this.HitBackFrame) { DDDraw.SetBright(1.0, 0.8, 1.0); } else { DDDraw.SetBright(1.0, 0.5, 0.0); } DDDraw.DrawBegin( Ground.I.Picture.WhiteBox, this.X - DDGround.ICamera.X + xBuru, this.Y - DDGround.ICamera.Y + yBuru ); DDDraw.DrawSetSize(100.0, 100.0); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetBorder(new I3Color(128, 64, 0)); DDPrint.SetPrint( (int)this.X - DDGround.ICamera.X - 46, (int)this.Y - DDGround.ICamera.Y - 46, 20 ); DDPrint.PrintLine("敵(仮)"); DDPrint.PrintLine("HP:" + this.HP); DDPrint.Reset(); this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(100.0, 100.0)); } yield return(true); } }
public void Main01(string spectrumFile, DDPicture jacket, string wDir, int spBarNum, int spBarWidth, int spBarHeight, I3Color spBarColor, double spBarAlpha, double z2) { FileTools.Delete(wDir); FileTools.CreateDir(wDir); this.SpData = new SpectrumData(spectrumFile); double a = -1.0; double foa = 0.0; double xz = DDConsts.Screen_W * 1.0 / jacket.Get_W(); double yz = DDConsts.Screen_H * 1.0 / jacket.Get_H(); double bz1 = Math.Max(xz, yz); double bz2 = Math.Min(xz, yz); double z1 = 1.0; //double z2 = 2.0; const int JACKET_MARGIN = 10; using (DDSubScreen pseudoMainScreen = new DDSubScreen( DDConsts.Screen_W, DDConsts.Screen_H )) using (DDSubScreen workScreen = new DDSubScreen( DDConsts.Screen_W, DDConsts.Screen_H )) using (DDSubScreen jacketScreen = new DDSubScreen( jacket.Get_W() + JACKET_MARGIN * 2, jacket.Get_H() + JACKET_MARGIN * 2, true )) { // ---- jacketScreen DDSubScreenUtils.ChangeDrawScreen(jacketScreen); DX.ClearDrawScreen(); DDDraw.DrawCenter(jacket, jacketScreen.GetSize().W / 2, jacketScreen.GetSize().H / 2); DDSubScreenUtils.RestoreDrawScreen(); // ---- SpectrumScreen0001 spScr = new SpectrumScreen0001(spBarNum, spBarWidth, spBarHeight, spBarColor); while (this.Frame < this.SpData.Rows.Length) { double[] row = this.SpData.Rows[this.Frame]; spScr.Draw(row); // ---- workScreen DDSubScreenUtils.ChangeDrawScreen(workScreen); DDDraw.DrawBegin(jacket, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(bz1 * z1); DDDraw.DrawEnd(); DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, 1000); //DDSubScreenUtils.RestoreDrawScreen(); // ---- pseudoMainScreen DDSubScreenUtils.ChangeDrawScreen(pseudoMainScreen); DDDraw.DrawSimple(workScreen.ToPicture(), 0, 0); DDCurtain.DrawCurtain(-0.5); DDDraw.DrawBegin( jacketScreen.ToPicture(), //jacket, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawZoom(bz2 * z2); DDDraw.DrawEnd(); DDCurtain.DrawCurtain(Math.Min(a, foa)); DDDraw.SetAlpha(spBarAlpha); DDDraw.DrawCenter(spScr.Screen.ToPicture(), DDConsts.Screen_W / 2, DDConsts.Screen_H - spBarHeight / 2 - 10); DDDraw.Reset(); // ここでフレームを保存 DX.SaveDrawScreenToJPEG(0, 0, DDConsts.Screen_W, DDConsts.Screen_H, Path.Combine(wDir, string.Format("{0}.jpg", this.Frame)), Consts.JPEG_QUALITY); //DX.SaveDrawScreen(0, 0, DDConsts.Screen_W, DDConsts.Screen_H, Path.Combine(wDir, string.Format("{0}.bmp", this.Frame))); DDSubScreenUtils.RestoreDrawScreen(); // ---- 以降、フレーム毎の処理 if (40 < this.Frame) { DDUtils.Approach(ref a, 0.0, 0.985); } if (this.SpData.Rows.Length - 40 < this.Frame) { DDUtils.Approach(ref foa, -1.0, 0.9); } //DDUtils.Approach(ref z1, 1.2, 0.999); //z1 += 0.0001; DDUtils.Approach(ref z2, 1.0, 0.9985); if (this.Frame % 30 == 0) // 毎回やる必要は無い。 { DDCurtain.DrawCurtain(); DDPrint.SetPrint(16, 16, 32); DDPrint.SetBorder(new I3Color(0, 64, 128)); DDPrint.PrintLine("ConvGenVideo"); //DDPrint.PrintLine("ConvGenVideo [Version " + DDUserDatStrings.Version + "]"); DDPrint.PrintLine("映像を生成しています..."); DDPrint.PrintLine("右上の[X]ボタンを押すと全ての処理を中止(キャンセル)します。"); { double rate = this.Frame * 1.0 / this.SpData.Rows.Length; const int PROGRESS_BAR_H = 10; DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, 0, (DDConsts.Screen_H - PROGRESS_BAR_H) / 2, Math.Max(5, DDConsts.Screen_W * rate), PROGRESS_BAR_H); } DDEngine.EachFrame(); } this.Frame++; } } }
public void Perform() { if (Ground.I.UseWallTrans) { this.WallPicture = Ground.I.Picture.WallTrans; } else { this.WallPicture = Ground.I.Picture.Wall; } this.WallBackPicture = Ground.I.Picture.WallTransBack; this.GatePicture = Ground.I.Picture.Gate; this.BackgroundPicture = Ground.I.Picture.Background; restart: this.Player.X = this.Map.DungeonMap.StartPoint.X; this.Player.Y = this.Map.DungeonMap.StartPoint.Y; this.Player.Direction = this.Map.DungeonMap.StartDirection; DDEngine.FreezeInput(); DDMusicUtils.Fade(); DDCurtain.SetCurtain(30, -0.8); for (; ;) // マップのプレビュー { if (DDInput.A.GetInput() == 1) { break; } if (DDInput.B.GetInput() == 1) { break; } if (DDInput.PAUSE.GetInput() == 1) { break; } DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(); DDCurtain.EachFrame(); this.DrawMap(); DDPrint.SetPrint(DDConsts.Screen_W / 2 - 90, DDConsts.Screen_H - 16); DDPrint.Print("PRESS Z KEY TO START"); DDEngine.EachFrame(); } DDEngine.FreezeInput(); Ground.I.Music.Maze.Play(); DDCurtain.SetCurtain(30, 0.0); this.Frame = 0; for (; ; this.Frame++) { if (DDInput.PAUSE.GetInput() == 1) // ポーズ・メニュー画面 { Ground.I.SE.PauseEnter.Play(); DDEngine.FreezeInput(); DDCurtain.SetCurtain(30, -0.8); const int ITEM_NUM = 3; int selectIndex = 0; for (; ;) { if (DDInput.PAUSE.GetInput() == 1) { break; } if (DDInput.DIR_2.IsPound()) { selectIndex++; } if (DDInput.DIR_8.IsPound()) { selectIndex--; } selectIndex += ITEM_NUM; selectIndex %= ITEM_NUM; if (DDInput.A.GetInput() == 1) { switch (selectIndex) { case 0: Ground.I.SE.Restart.Play(); goto restart; case 1: Ground.I.SE.ReturnToTitle.Play(); goto endGame; case 2: goto endPauseMenu; default: throw null; // never } } if (DDInput.B.GetInput() == 1) { if (selectIndex == ITEM_NUM - 1) { goto endPauseMenu; } selectIndex = ITEM_NUM - 1; } DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(); DDCurtain.EachFrame(); DDDraw.SetBright(new I3Color(0, 0, 100)); DDDraw.SetAlpha(0.3); DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawSetSize(300, 200); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetPrint(380, 215, 50); { int c = 0; DDPrint.PrintLine("[" + (selectIndex == c++ ? ">" : " ") + "] この迷路をやり直す"); DDPrint.PrintLine("[" + (selectIndex == c++ ? ">" : " ") + "] タイトルに戻る"); DDPrint.PrintLine("[" + (selectIndex == c++ ? ">" : " ") + "] 迷路に戻る"); } DDEngine.EachFrame(); } endPauseMenu: DDCurtain.SetCurtain(30, 0.0); Ground.I.SE.PauseLeave.Play(); } if (1 <= DDInput.DIR_8.GetInput()) { foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout, true); this.DrawDungeon(); DDEngine.EachFrame(); } if (this.Map[this.Player.X, this.Player.Y].GetWall(this.Player.Direction).Kind == MapWall.Kind_e.WALL) { // 壁衝突 Ground.I.SE.Poka.Play(); } else { switch (this.Player.Direction) { case 4: this.Player.X--; break; case 6: this.Player.X++; break; case 8: this.Player.Y--; break; case 2: this.Player.Y++; break; default: throw null; // never } } foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout, false); this.DrawDungeon(); DDEngine.EachFrame(); } } if (1 <= DDInput.DIR_4.GetInput()) { foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(scene.Rate); DDEngine.EachFrame(); } this.Player.Direction = Utilities.RotL(this.Player.Direction); foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(-scene.RemainingRate); DDEngine.EachFrame(); } } if (1 <= DDInput.DIR_6.GetInput()) { foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(-scene.Rate); DDEngine.EachFrame(); } this.Player.Direction = Utilities.RotR(this.Player.Direction); foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(scene.RemainingRate); DDEngine.EachFrame(); } } if (1 <= DDInput.DIR_2.GetInput()) { foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(-scene.Rate); DDEngine.EachFrame(); } this.Player.Direction = Utilities.RotR(this.Player.Direction); foreach (DDScene scene in DDSceneUtils.Create(10)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(scene.RemainingRate * 2.0 - 1.0); DDEngine.EachFrame(); } this.Player.Direction = Utilities.RotR(this.Player.Direction); foreach (DDScene scene in DDSceneUtils.Create(5)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(scene.RemainingRate); DDEngine.EachFrame(); } } if (this.Map[this.Player.X, this.Player.Y].Script == MapCellScript.GOAL) { Ground.I.Music.Completed.Play(); DDCurtain.SetCurtain(30, -0.8); DDEngine.FreezeInput(30); for (; ;) { if (DDInput.A.GetInput() == 1) { break; } if (DDInput.B.GetInput() == 1) { break; } if (DDInput.PAUSE.GetInput() == 1) { break; } DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(); DDCurtain.EachFrame(); DDDraw.DrawCenter(Ground.I.Picture.CongratulationsPanel, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDPrint.SetPrint(DDConsts.Screen_W / 2 - 100, DDConsts.Screen_H - 16); DDPrint.Print("PRESS Z KEY TO CONTINUE"); DDEngine.EachFrame(); } // クリア後メニュー { DDEngine.FreezeInput(); DDCurtain.SetCurtain(30, -0.8); const int ITEM_NUM = 3; int selectIndex = 0; for (; ;) { if (DDInput.PAUSE.GetInput() == 1) { break; } if (DDInput.DIR_2.IsPound()) { selectIndex++; } if (DDInput.DIR_8.IsPound()) { selectIndex--; } selectIndex += ITEM_NUM; selectIndex %= ITEM_NUM; if (DDInput.A.GetInput() == 1) { switch (selectIndex) { case 0: { DDEngine.FreezeInput(); for (; ;) { if (DDInput.A.GetInput() == 1) { break; } if (DDInput.B.GetInput() == 1) { break; } if (DDInput.PAUSE.GetInput() == 1) { break; } DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(); DDCurtain.EachFrame(); this.DrawMap(); DDPrint.SetPrint(DDConsts.Screen_W / 2 - 90, DDConsts.Screen_H - 16); DDPrint.Print("PRESS Z KEY TO RETURN"); DDEngine.EachFrame(); } DDEngine.FreezeInput(); } break; case 1: goto restart; case 2: goto endGame; default: throw null; // never } } if (DDInput.B.GetInput() == 1) { if (selectIndex == ITEM_NUM - 1) { break; } selectIndex = ITEM_NUM - 1; } DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(); DDCurtain.EachFrame(); DDDraw.SetBright(new I3Color(100, 0, 0)); DDDraw.SetAlpha(0.7); DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2); DDDraw.DrawSetSize(400, 200); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetPrint(330, 215, 50); { int c = 0; DDPrint.PrintLine("[" + (selectIndex == c++ ? ">" : " ") + "] マップを確認する"); DDPrint.PrintLine("[" + (selectIndex == c++ ? ">" : " ") + "] この迷路をもう一度プレイする"); DDPrint.PrintLine("[" + (selectIndex == c++ ? ">" : " ") + "] タイトルに戻る"); } DDEngine.EachFrame(); } } break; } // Draw ... DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(); DDEngine.EachFrame(); } endGame: DDCurtain.SetCurtain(30, -1.0); DDMusicUtils.Fade(); foreach (DDScene scene in DDSceneUtils.Create(40)) { DungeonScreen.DrawFront(this.Layout); this.DrawDungeon(); DDEngine.EachFrame(); } }