protected override IEnumerable <bool> E_Draw() { D2Point speed = GameCommon.GetXYSpeed(this.Direction, 10.0); DDUtils.Rotate(ref speed.X, ref speed.Y, this.R); for (int frame = 0; ; frame++) { this.X += speed.X; this.Y += speed.Y; DDDraw.DrawBegin(Ground.I.Picture2.IconSet[1, 35], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(frame / 2.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 10.0); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))); // カメラの外に出たら(画面から見えなくなったら)消滅する。 } }
protected override IEnumerable <bool> E_Draw() { double baseRad = DDUtils.Random.GetInt(2) == 0 ? 0.0 : Math.PI; for (int frame = 0; ; frame++) { this.X += 10.0 * (this.FacingLeft ? -1 : 1); double x = this.X; double y = this.Y + Math.Sin(baseRad + frame / 2.0) * 50.0; DDDraw.DrawBegin(Ground.I.Picture2.FireBall[14 + frame % 7], x - DDGround.ICamera.X, y - DDGround.ICamera.Y); DDDraw.DrawZoom(0.1); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(x, y), 8.0); yield return(!DDUtils.IsOutOfCamera(new D2Point(x, y))); // カメラから出たら消滅する。 } }
protected override IEnumerable <bool> E_Draw() { double ctrx = this.X; double ctry = this.Y; D2Point speed = GameCommon.GetXYSpeed(this.Direction, 5.5); for (int frame = 0; ; frame++) { ctrx += speed.X; ctry += speed.Y; double xadd = speed.Y * 20.0; double yadd = speed.X * 20.0; if (this.左回転) { xadd *= -1.0; } else { yadd *= -1.0; } double rate = Math.Sin(frame / 20.0); xadd *= rate; yadd *= rate; this.X = ctrx + xadd; this.Y = ctry + yadd; DDDraw.DrawBegin(Ground.I.Picture2.IconSet[2, 35], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawRotate(frame / 2.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 10.0); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))); // カメラの外に出たら(画面から見えなくなったら)消滅する。 } }
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 override void Draw() { if (!EnemyCommon.IsOutOfScreen_ForDraw(this)) { double p = Math.Sin(DDEngine.ProcFrame / 10.0 + this.X + this.Y) * 0.5 + 0.5; // color phaese DDDraw.SetBright(new I3Color( SCommon.ToInt(DDUtils.AToBRate(Game.I.Map.Design.EnemyColor_Death_A.R, Game.I.Map.Design.EnemyColor_Death_B.R, p)), SCommon.ToInt(DDUtils.AToBRate(Game.I.Map.Design.EnemyColor_Death_A.G, Game.I.Map.Design.EnemyColor_Death_B.G, p)), SCommon.ToInt(DDUtils.AToBRate(Game.I.Map.Design.EnemyColor_Death_A.B, Game.I.Map.Design.EnemyColor_Death_B.B, p)) )); DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, SCommon.ToInt(this.X - DDGround.ICamera.X), SCommon.ToInt(this.Y - DDGround.ICamera.Y)); DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H)); //Game.I.タイル接近_敵描画_Points.Add(new D2Point(this.X, this.Y)); // 地形の一部なので、追加しない。 } }
// <---- prm public override IEnumerable <bool> E_Task() { for (; ;) { this.X += this.XAdd; this.Y += this.YAdd; if (this.X < 0.0) { this.X += DDConsts.Screen_W; } DDDraw.SetAlpha(0.2); DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X, this.Y); DDDraw.DrawZoom(this.R / (Ground.I.Picture.WhiteCircle.Get_W() / 2.0)); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(this.Y < DDConsts.Screen_H + 10.0); } }
private void カットイン() { DDMain.KeepMainScreen(); foreach (DDScene scene in DDSceneUtils.Create(40)) { DDDraw.DrawSimple(DDGround.KeptMainScreen.ToPicture(), 0, 0); DDDraw.SetBright(0, 0, 0); DDDraw.SetAlpha(1.0 - scene.Rate); DDDraw.DrawBegin( Ground.I.Picture.WhiteCircle, Game.I.Player.X - DDGround.ICamera.X, Game.I.Player.Y - DDGround.ICamera.Y ); DDDraw.DrawZoom(0.3 + 20.0 * scene.Rate); DDDraw.DrawEnd(); DDDraw.Reset(); DDEngine.EachFrame(); } }
public override void Draw() { if (Game.I.Player.DeadFrame != 0) // ? プレイヤー死亡 { DDUtils.Approach(ref this.Speed, 4.0, 0.9); } else { DDUtils.Approach(ref this.Speed, 9.0, 0.975); } D2Point currSpeed = DDUtils.AngleToPoint(this.Angle, this.Speed); this.X += currSpeed.X; this.Y += currSpeed.Y; DDDraw.SetBright(this.Color); DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, SCommon.ToInt(this.X - DDGround.ICamera.X), SCommon.ToInt(this.Y - DDGround.ICamera.Y)); DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H); DDDraw.DrawRotate(this.Rot); DDDraw.DrawEnd(); DDDraw.Reset(); this.RotAdd += this.RotAddAdd; this.Rot += this.RotAdd; //this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H)); // old this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), GameConsts.TILE_W / 2.0); Game.I.タイル接近_敵描画_Points.Add(new D2Point(this.X, this.Y)); if ( Game.I.Player.DeadFrame == 0 && // ? プレイヤー生存 DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0) ) { this.DeadFlag = true; } }
private void Test01() { for (; ;) { if (DDInput.A.GetInput() == 1) { break; } DDCurtain.DrawCurtain(); DDPrint.SetPrint(); DDPrint.Print("FrameProcessingMillis: " + DDEngine.FrameProcessingMillis); DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0); DDDraw.DrawZoom(10.0); DDDraw.DrawRotate(DDEngine.ProcFrame / 20.0); DDDraw.DrawEnd(); DDEngine.EachFrame(); } }
public static IEnumerable <bool> EnemyKilled(double x, double y) { foreach (DDPicture picture in Ground.I.Picture2.EnemyKilled) { for (int c = 0; c < 5; c++) { DDDraw.SetAlpha(0.8); DDDraw.DrawBegin( picture, x - DDGround.ICamera.X, y - DDGround.ICamera.Y ); DDDraw.DrawZoom(1.5); DDDraw.DrawEnd(); DDDraw.Reset(); y += 1.0; yield return(true); } } }
protected override IEnumerable <bool> E_Draw() { double SCALE = LevelToScale(this.Level); double R = SCommon.ToInt(24.0 * SCALE); double yAdd = 0.0; // 初期位置調整 { this.X += (36.0 + R * (1 + 2 * this.Order)) * (this.FacingLeft ? -1 : 1); //this.Y += 0.0; } for (; ;) { yAdd -= (0.2 + 0.05 * this.Order) * SCALE; this.X += (4.0 + 0.5 * this.Order) * SCALE * (this.FacingLeft ? -1 : 1); this.Y += yAdd; DDDraw.SetBright(new I3Color(0, 192, 192)); DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(R * 2, R * 2); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetDebug( (int)this.X - DDGround.ICamera.X - 12, (int)this.Y - DDGround.ICamera.Y - 8 ); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("AS" + this.Level); DDPrint.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), R)); // カメラから出たら消滅する。 } }
protected override IEnumerable <bool> E_Draw() { // ---- game_制御 ---- if (Game.I.Status.神奈子を倒した) { yield break; } // ---- Func <bool> f_閉鎖 = SCommon.Supplier(this.E_閉鎖()); double targ_x = this.X; double targ_y = this.Y; this.X = Game.I.Map.W / 2.0; this.Y = -100.0; foreach (DDScene scene in DDSceneUtils.Create(120)) { f_閉鎖(); DDUtils.Approach(ref this.X, targ_x, 0.9); DDUtils.Approach(ref this.Y, targ_y, 0.9); bool facingLeft = Game.I.Player.X < this.X; DDDraw.DrawBegin(Ground.I.Picture2.Enemy_神奈子[0], this.X, this.Y); DDDraw.DrawSlide(20.0, 10.0); DDDraw.DrawZoom_X(facingLeft ? 1 : -1); DDDraw.DrawEnd(); // 当たり判定無し yield return(true); } Game.I.Enemies.Add(new Enemy_B神奈子0001(this.X, this.Y)); }
protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { this.X += this.XAdd; EnemyCommon.Shoot(this, this.ShotType); int koma = frame / 7; koma %= 2; DDDraw.SetMosaic(); DDDraw.DrawBegin(Ground.I.Picture2.D_PUMPKIN_00[koma], this.X, this.Y); DDDraw.DrawZoom(2.0); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X - 1.0, this.Y + 3.0), 30.0); yield return(!EnemyCommon.IsEvacuated(this)); } }
private IEnumerable <bool> GetLayer02(string imgFile, int xDirSign) { DDPicture img = DDPictureLoaders.Standard(imgFile); // g double x = DDConsts.Screen_W * xDirSign; double y = -190.0; double a = 0.1; for (; ;) { DDDraw.DrawBegin(img, DDConsts.Screen_W / 2 + x, DDConsts.Screen_H / 2 + y); DDDraw.DrawZoom(1.353); DDDraw.SetAlpha(a); DDDraw.DrawEnd(); DDUtils.Approach(ref x, 0.0, 0.45); DDUtils.Approach(ref y, 190.0, 0.9); DDUtils.Approach(ref a, 1.0, 0.95); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { double SCALE = LevelToScale(this.Level); double R = SCommon.ToInt(24.0 * SCALE); int yAddDir = 0; for (; ;) { if (yAddDir == 0) { this.X += 10.0 * (this.FacingLeft ? -1 : 1); yAddDir = this.索敵(R); } else { this.Y += 10.0 * yAddDir; } DDDraw.SetBright(new I3Color(0, 192, 255)); DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(R * 2, R * 2); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetDebug( (int)this.X - DDGround.ICamera.X - 12, (int)this.Y - DDGround.ICamera.Y - 8 ); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("MA" + this.Level); DDPrint.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), R)); // カメラから出たら消滅する。 } }
protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { int koma = frame / 4; if (Ground.I.Picture2.ほむらバズーカ.Length <= koma) { break; } double x = Game.I.Player.X; double y = Game.I.Player.Y; double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; bool facingLeft = Game.I.Player.FacingLeft; if (frame == 6 * 4) { Game.I.Shots.Add(new Shot_ほむら接地攻撃( x + 50.0 * xZoom, y - 18.0, facingLeft )); } DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( Ground.I.Picture2.ほむらバズーカ[koma], x - DDGround.ICamera.X, y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { while (DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) // 画面内に入るまで休止する。 { yield return(true); } this.FacingLeft = Game.I.Player.X < this.X; DDPicture[] pictures = new DDPicture[] { Ground.I.Picture.Teki_a01_Fly01, Ground.I.Picture.Teki_a01_Fly02, Ground.I.Picture.Teki_a01_Fly03, Ground.I.Picture.Teki_a01_Fly02, }; Func <bool> f_attack = SCommon.Supplier(this.E_Attack()); for (int frame = 0; ; frame++) { f_attack(); const double SPEED = 4.0; this.X += this.FacingLeft ? -SPEED : SPEED; if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { DDDraw.DrawBegin(pictures[frame / 8 % 4], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawZoom_X(this.FacingLeft ? 1.0 : -1.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 12.0); } yield return(true); } }
private IEnumerable <bool> GetLayer01(string imgFile) { DDPicture img = DDPictureLoaders.Standard(imgFile); // g double y = -190.0; double b = 10000.0; double cLv = -1.0; for (; ;) { using (DDSubScreen workScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H)) { DDSubScreenUtils.ChangeDrawScreen(workScreen); DDDraw.DrawBegin(img, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2 + y); DDDraw.DrawZoom(1.353); DDDraw.DrawEnd(); DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 1 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 2 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 3 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 4 DX.GraphFilter(workScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, (int)b); // 5 DDSubScreenUtils.RestoreDrawScreen(); DDDraw.DrawSimple(DDPictureLoaders2.Wrapper(workScreen), 0, 0); } DDCurtain.DrawCurtain(cLv); DDUtils.Approach(ref y, 190.0, 0.9); DDUtils.Approach(ref b, 0.0, 0.7); DDUtils.Approach(ref cLv, 0.0, 0.8); yield return(true); } }
private void P_Draw() { if (FRAME_MAX < this.Frame) { Game.I.Enemies.Add(new Enemy_B0003(this.DestX, this.DestY)); this.DeadFlag = true; } if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { double x = DDUtils.AToBRate(this.X, this.DestX, DDUtils.SCurve(this.Frame * 1.0 / FRAME_MAX)); double y = DDUtils.AToBRate(this.Y, this.DestY, DDUtils.SCurve(this.Frame * 1.0 / FRAME_MAX)); DDDraw.SetBright(1.0, 0.0, 0.0); DDDraw.DrawBegin(Ground.I.Picture.Enemy_B0003, x - DDGround.ICamera.X, y - DDGround.ICamera.Y); DDDraw.DrawRotate(this.Frame * 10.0 / FRAME_MAX); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(x, y), 50.0); } this.Frame++; }
public override void DrawPlayer() { double map_b = Game.I.Map.H * GameConsts.TILE_H; double pl_y = Game.I.Player.Y; double y = (map_b - 70) - pl_y; y /= 300.0; y = Math.Abs(y); if (y < 1.0) { DDDraw.SetAlpha(y); } DDDraw.DrawBegin( Ground.I.Picture.WhiteBox, SCommon.ToInt(Game.I.Player.X - DDGround.ICamera.X), SCommon.ToInt(Game.I.Player.Y - DDGround.ICamera.Y) ); DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H); DDDraw.DrawEnd(); DDDraw.Reset(); }
protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { int koma = frame; //int koma = frame / 2; //int koma = frame / 3; if (Ground.I.Picture2.Cirno_しゃがみ攻撃.Length <= koma) { break; } double x = Game.I.Player.X + 16 * (Game.I.Player.FacingLeft ? -1.0 : 1.0); double y = Game.I.Player.Y - 8; double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; bool facingLeft = Game.I.Player.FacingLeft; if (frame == 6 * 4) { // TODO: 当たり判定設定 } DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( Ground.I.Picture2.Cirno_しゃがみ攻撃[koma], x - DDGround.ICamera.X, y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } }
public void Test01() { DDCurtain.SetCurtain(); DDEngine.FreezeInput(); foreach (DDScene scene in DDSceneUtils.Create(600)) { if (DDInput.A.GetInput() == 1) { break; } DDCurtain.DrawCurtain(); DDDraw.DrawBegin(DDGround.GeneralResource.Dummy, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0); DDDraw.DrawZoom(5.0); DDDraw.DrawRotate(scene.Rate * 5.0); DDDraw.DrawEnd(); DDEngine.EachFrame(); } DDEngine.FreezeInput(); }
public override void Draw() { this.X += this.XSpeed; this.Y += this.YSpeed; if (this.Y < this.Highest_Y) { DDUtils.Approach(ref this.YSpeed, 重力加速度, 0.9); } this.YSpeed = Math.Min(落下最高速度, this.YSpeed); int ix = SCommon.ToInt(this.X); int iy = SCommon.ToInt(this.Y); Around a2 = new Around(ix, iy, 2); int xDirSign = 0; int yDirSign = 0; if (this.Y < this.Highest_Y + 24.0) // ? 最高高度に近い { if ( a2.Table[0, 0].IsEnemyPataWall() || a2.Table[0, 1].IsEnemyPataWall() ) { xDirSign++; } if ( a2.Table[1, 0].IsEnemyPataWall() || a2.Table[1, 1].IsEnemyPataWall() ) { xDirSign--; } } else { if ( a2.Table[0, 0].IsEnemyPataWall() && a2.Table[0, 1].IsEnemyPataWall() ) { xDirSign++; } if ( a2.Table[1, 0].IsEnemyPataWall() && a2.Table[1, 1].IsEnemyPataWall() ) { xDirSign--; } } if ( !a2.Table[0, 0].IsEnemyPataWall() && a2.Table[0, 1].IsEnemyPataWall() || !a2.Table[1, 0].IsEnemyPataWall() && a2.Table[1, 1].IsEnemyPataWall() ) { yDirSign = -1; } else if ( a2.Table[0, 0].IsEnemyPataWall() && a2.Table[1, 0].IsEnemyPataWall() ) { yDirSign = 1; } else { this.YSpeed += 重力加速度; } if (xDirSign != 0) { this.XSpeed = Math.Abs(this.XSpeed) * xDirSign; } if (yDirSign != 0) { this.YSpeed = Math.Abs(this.YSpeed) * yDirSign; } if (!EnemyCommon.IsOutOfScreen_ForDraw(this)) { //DDDraw.SetBright(new I3Color(192, 32, 32)); // old DDDraw.SetBright(Game.I.Map.Design.EnemyColor_Pata); DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, SCommon.ToInt(this.X - DDGround.ICamera.X), SCommon.ToInt(this.Y - DDGround.ICamera.Y)); DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H)); Game.I.タイル接近_敵描画_Points.Add(new D2Point(this.X, this.Y)); } }
public void Perform() { // 開発中_暫定 { int endFrame = DDEngine.ProcFrame + 300; DDGround.EL.Add(() => { int sec = endFrame - DDEngine.ProcFrame; DDPrint.SetPrint(180, DDConsts.Screen_H - 32); DDPrint.Print("これはクローズドテスト版です。仮リソース・実装されていない機能を含みます。(あと " + (sec / 60.0).ToString("F1") + " 秒で消えます)"); return(0 < sec); }); } 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 IEnumerable <bool> E_Jump(double jumpSpeed) { double ySpeed = -jumpSpeed; const double SPEED_X = 3.0; const double GRAVITY = 0.5; for (int frame = 0; frame < 5; frame++) { DDDraw.DrawBegin(Ground.I.Picture.Teki_a03_Jump02, this.X - DDGround.ICamera.X, this.Y - 16 - DDGround.ICamera.Y); DDDraw.DrawZoom_X(this.FacingLeft ? 1.0 : -1.0); DDDraw.DrawEnd(); yield return(true); } for (int frame = 0; ; frame++) { if (this.FacingLeft) { if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X - 20.0, this.Y)).Tile.IsWall()) { this.FacingLeft = false; } } else { if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X + 20.0, this.Y)).Tile.IsWall()) { this.FacingLeft = true; } } if ( ySpeed < 0.0 && // ? 上昇中 Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X, this.Y - 20.0)).Tile.IsWall() ) { ySpeed = 0.0; } if (0.0 < ySpeed) // ? 降下中 { I2Point pt = GameCommon.ToTablePoint(this.X, this.Y + 30.0); if (Game.I.Map.GetCell(pt).Tile.IsGround()) { this.Y = pt.Y * GameConsts.TILE_H - GameConsts.TILE_H / 2; break; } } if (Game.I.Map.H * GameConsts.TILE_H + 50.0 < this.Y) // ? 画面下に十分出た。 { this.DeadFlag = true; // 消滅 } this.X += this.FacingLeft ? -SPEED_X : SPEED_X; this.Y += ySpeed; ySpeed += GRAVITY; DDDraw.DrawBegin(Ground.I.Picture.Teki_a03_Jump03, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawZoom_X(this.FacingLeft ? 1.0 : -1.0); DDDraw.DrawEnd(); yield return(true); } this.WaitFrame = 0; }
public void Draw() { if (1 <= this.Draw_EL.Count) { this.Draw_EL.ExecuteAllTask(); return; } double xZoom = this.FacingLeft ? -1 : 1; double yZoom = 1.0; DDPicture picture = null; double xa = 0.0; double ya = 0.0; // 各種モーション { // ? 滞空状態 if ( 1 <= Game.I.Player.AirborneFrame || Game.I.Player.YSpeed < -SCommon.MICRO // ジャンプ中に梯子の一番上あたりに来たとき、接地状態になってしまわないように、この判定が要る。 ) { if (1 <= this.ShootingFrame) { picture = Ground.I.Picture.Chara_A01_Jump_Attack; } else { picture = Ground.I.Picture.Chara_A01_Jump; } } else if (1 <= this.MoveFrame) { if (1 <= this.ShootingFrame) { picture = Ground.I.Picture.Chara_A01_Run_Attack[(Game.I.Frame / 5) % Ground.I.Picture.Chara_A01_Run_Attack.Length]; } else { int koma = Game.I.Frame / 5; if (koma == 0) { picture = Ground.I.Picture.Chara_A01_Wait_Start; } else { picture = Ground.I.Picture.Chara_A01_Run[koma % Ground.I.Picture.Chara_A01_Run.Length]; } } } else { if (1 <= this.ShootingFrame) { picture = Ground.I.Picture.Chara_A01_Wait_Attack; } else { if (DDEngine.ProcFrame / 10 % 20 == 0) { picture = Ground.I.Picture.Chara_A01_Wait_Mabataki; } else { picture = Ground.I.Picture.Chara_A01_Wait; } } } } if (1 <= this.DeadFrame) // 死亡モーション { // 注意:this.DeadFrame == 0 ~ Consts.PLAYER_DEAD_FRAME_MAX + 2 goto endDraw; // ティウンティウンになったので、描画しない。 } if (1 <= this.DamageFrame) // 被弾モーション { // 注意:this.DamageFrame == 0 ~ Consts.PLAYER_DAMAGE_FRAME_MAX + 2 if (this.DamageFrame / 6 % 2 == 0) { picture = Ground.I.Picture.Effect_A01_Shock_A; } else { picture = Ground.I.Picture.Chara_A01_Jump_Damage; } } if (1 <= this.DamageFrame || 1 <= this.InvincibleFrame) { DDDraw.SetTaskList(DDGround.EL); //DDDraw.SetTaskList(DDGround.EL_先行); // old } if (1 <= this.InvincibleFrame) { DDDraw.SetAlpha(0.5); } double x = this.X; double y = this.Y; // 整数化 x = (int)x; y = (int)y; DDDraw.DrawBegin( picture, x - DDGround.ICamera.X + (xa * xZoom), y - DDGround.ICamera.Y + ya ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawZoom_Y(yZoom); DDDraw.DrawEnd(); DDDraw.Reset(); endDraw: ; }
public void Main01(string rDir, string wDir) { this.RDir = rDir; this.WDir = wDir; if (Directory.Exists(this.RDir) == false) { throw new Exception("no RDir: " + this.RDir); } FileTools.Delete(this.WDir); FileTools.CreateDir(this.WDir); DDPicture jacket = DDPictureLoaders.Standard(Path.Combine(this.RDir, "Jacket.jpg")); // g this.SpData = new SpectrumData(Path.Combine(this.RDir, "Spectrum.csv")); 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; DDSubScreen workScreen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H); // g DDSubScreen jacketScreen = new DDSubScreen(jacket.Get_W() + JACKET_MARGIN * 2, jacket.Get_H() + JACKET_MARGIN * 2, true); // g // ---- jacketScreen DDSubScreenUtils.ChangeDrawScreen(jacketScreen); DX.ClearDrawScreen(); DDDraw.DrawCenter(jacket, jacketScreen.GetSize().W / 2, jacketScreen.GetSize().H / 2); DDSubScreenUtils.RestoreDrawScreen(); // ---- SpectrumScreen0001 spScr = new SpectrumScreen0001(); while (this.Frame < this.SpData.Rows.Length) { double[] row = this.SpData.Rows[this.Frame]; // ---- 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(); // ---- 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)); spScr.Draw(this.SpData.Rows[this.Frame]); DDDraw.SetAlpha(0.6); // ★要調整 DDDraw.DrawCenter(spScr.Screen.ToPicture(), DDConsts.Screen_W / 2, DDConsts.Screen_H - 110); DDDraw.Reset(); 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); this.MG_EachFrame(); } }
public override IEnumerable <bool> E_Task() { DDTaskList el = new DDTaskList(); double dx = 0.0; double dy = 0.0; double ldx; double ldy; double shadow_a = 0.0; double shadow_x = 0.0; double title_a = 0.0; double shadow_targ_a; double shadow_targ_x; double title_targ_a; for (int frame = 0; ; frame++) { ldx = dx; ldy = dy; dx = Math.Cos(frame / 199.0) * 40.0; dy = Math.Cos(frame / 211.0) * 30.0; double dxa = dx - ldx; double dya = dy - ldy; DDDraw.DrawBegin(Ground.I.Picture.TitleWall, DDConsts.Screen_W / 2 + dx, DDConsts.Screen_H / 2 + dy); DDDraw.DrawZoom(1.3); DDDraw.DrawEnd(); if (1 <= frame && DDUtils.Random.Real() < 0.03 + Math.Sin(frame / 307.0) * 0.02) { el.Add(SCommon.Supplier(this.Effect_0001(dx, dy, dxa, dya))); } el.ExecuteAllTask_Reverse(); double titleX = 720.0 + dx * 0.4; double titleY = 270.0 + dy * 0.4; double tba = 0.5 + Math.Sin(frame / 103.0) * 0.185 + Math.Sin(frame / 3.0) * 0.015 * Math.Sin(frame / 107.0); double tfa = 0.3; tba *= title_a; tfa *= title_a; { const int FRAME_MAX = 300; if (frame < FRAME_MAX) { DDDraw.SetBlendAdd(frame * tba / FRAME_MAX); DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY); DDDraw.Reset(); } else { DDDraw.SetBlendAdd(tba); DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY); DDDraw.Reset(); } } { const int FRAME_MAX = 300; if (frame < FRAME_MAX) { DDDraw.SetBlendAdd(frame * tfa / FRAME_MAX); DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY); DDDraw.Reset(); } else { DDDraw.SetBlendAdd(tfa); DDDraw.DrawCenter(Ground.I.Picture.Title, titleX, titleY); DDDraw.Reset(); } } if (this.DeepConfigEntered) { shadow_targ_a = 0.3; shadow_targ_x = DDConsts.Screen_W; title_targ_a = 0.0; } else if (this.TopMenuLeaved) { shadow_targ_a = 0.3; shadow_targ_x = 480.0; title_targ_a = 1.0; } else { shadow_targ_a = 0.0; shadow_targ_x = 30.0; title_targ_a = 1.0; } DDUtils.Approach(ref shadow_a, shadow_targ_a, 0.8); DDUtils.Approach(ref shadow_x, shadow_targ_x, 0.8); DDUtils.Approach(ref title_a, title_targ_a, 0.97); DDDraw.SetAlpha(shadow_a); DDDraw.SetBright(0, 0, 0); DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, 0, shadow_x, DDConsts.Screen_H); DDDraw.Reset(); yield return(true); } }
public void Perform() { 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(); } foreach (DDScene scene in DDSceneUtils.Create(90)) { 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(); } }
protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { int koma = frame / 4; if (3 <= koma) { break; } // 移動 { const double SPEED = 3.0; if (Game.I.Player.FacingLeft) { Game.I.Player.X -= SPEED; } else { Game.I.Player.X += SPEED; } } AttackCommon.ProcPlayer_側面(); double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( Ground.I.Picture2.さやか突き[koma], Game.I.Player.X - DDGround.ICamera.X + 30.0 * xZoom, Game.I.Player.Y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } for (int frame = 0; frame < 60; frame++) { if ( 10 < frame && DDInput.C.GetInput() <= 0 // ? 特殊攻撃ボタンを離した。 ) { break; } int koma = 3 + (frame / 3) % 3; // 移動 { const double SPEED_X = 12.0; const double SPEED_Y = 2.0; if (Game.I.Player.FacingLeft) { Game.I.Player.X -= SPEED_X; } else { Game.I.Player.X += SPEED_X; } if (1 <= DDInput.DIR_8.GetInput()) { Game.I.Player.Y -= SPEED_Y; } if (1 <= DDInput.DIR_2.GetInput()) { Game.I.Player.Y += SPEED_Y; } } AttackCommon.ProcPlayer_脳天(); AttackCommon.ProcPlayer_接地(); if (AttackCommon.ProcPlayer_側面()) { break; } double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; Game.I.Shots.Add(new Shot_さやか突き( Game.I.Player.X + 50.0 * xZoom, Game.I.Player.Y, Game.I.Player.FacingLeft )); DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( Ground.I.Picture2.さやか突き[koma], Game.I.Player.X - DDGround.ICamera.X, Game.I.Player.Y - DDGround.ICamera.Y + 8.0 ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } for (int frame = 0; ; frame++) { int koma = 6 + frame / 2; if (10 <= koma) { break; } double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0; DDDraw.SetTaskList(Game.I.Player.Draw_EL); DDDraw.DrawBegin( Ground.I.Picture2.さやか突き[koma], Game.I.Player.X - DDGround.ICamera.X + 30.0 * xZoom, Game.I.Player.Y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } // 後処理 { Game.I.Player.YSpeed = 0.0; } }