protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { double ax = 0.0; double ay = -20.0; DDUtils.Rotate(ref ax, ref ay, this.R); this.X += ax; this.Y += ay; if (DDUtils.IsOut(new D2Point(this.X, this.Y), new D4Rect(0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H))) { break; } DDDraw.SetAlpha(ShotConsts.A); DDDraw.DrawBegin(Ground.I.Picture2.D_SHOT, this.X, this.Y); DDDraw.DrawRotate(this.R); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle( new D2Point(this.X, this.Y), 12.0 ); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { double axisX = this.X; double axisY = this.Y; for (int frame = 0; ; frame++) { axisX += this.XAdd; axisY += this.YAdd; DDUtils.Approach(ref this.R, 0.0, this.RApproachingRate); this.Rot += this.RotAdd; this.X = axisX + Math.Cos(this.Rot) * this.R; this.Y = axisY + Math.Sin(this.Rot) * this.R; EnemyCommon.Shoot(this, this.ShotType); int koma = frame / 5; koma %= 2; DDDraw.SetMosaic(); DDDraw.DrawBegin(Ground.I.Picture2.D_PUMPKIN_00_GRBA[koma], this.X, this.Y); DDDraw.DrawZoom(3.0); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y + 4.0), 45.0); yield return(!EnemyCommon.IsEvacuated(this)); } }
protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { this.Y -= 18.0; if (this.Y < 0.0) { break; } DDDraw.SetAlpha(ShotConsts.A); DDDraw.DrawBegin(Ground.I.Picture2.D_LASER, this.X, this.Y); DDDraw.DrawZoom(1.0 + (0.5 * this.Level) / GameConsts.PLAYER_LEVEL_MAX); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle( new D2Point(this.X, this.Y), 32.0 + (16.0 * this.Level) / GameConsts.PLAYER_LEVEL_MAX ); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { const double CHARA_R = 8.0; for (; ;) { this.X += this.XAdd; this.Y += this.YAdd; // 壁衝突判定 //if (Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(this.X, this.Y))).Tile.IsWall()) // break; if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), CHARA_R * 1.2)) { // 暫定_描画 { DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(CHARA_R * 2, CHARA_R * 2); DDDraw.DrawEnd(); DDPrint.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("[敵弾]"); DDPrint.Reset(); } this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), CHARA_R); } yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))); } }
protected override IEnumerable <bool> E_Draw() { double axisX = this.X; for (int frame = 0; ; frame++) { this.X = axisX + Math.Sin(this.Rot) * this.XRate; this.Y += this.YAdd; this.Rot += this.RotAdd; 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)); } }
protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { double ax = 0.0; double ay = -15.0; DDUtils.Rotate(ref ax, ref ay, this.R); this.X += ax; this.Y += ay; //if (DDUtils.IsOut(new D2Point(this.X, this.Y), new D4Rect(0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H))) // break; this.R += this.RAdd; DDUtils.Approach(ref this.RAdd, 0.0, this.RAddRatePerFrame); DDDraw.SetAlpha(ShotConsts.A * 2.0); DDDraw.SetBright(1.0, 0.3, 0.3); DDDraw.DrawBegin(Ground.I.Picture2.D_WAVESHOT, this.X, this.Y); DDDraw.DrawRotate(this.R); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle( new D2Point(this.X, this.Y), 24.0 ); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { for (this.WaitFrame = 0; ; this.WaitFrame++) { while (DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) // 画面外に居るときは休止する。 { yield return(true); } if (!this.Jump()) { this.FacingLeft = Game.I.Player.X < this.X; if ( 30 < this.WaitFrame && ( DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 300.0 || Math.Abs(Game.I.Player.Y - this.Y) < 32.0 )) { this.Jump = SCommon.Supplier(this.E_Jump(this.Random.Real() < 0.5 ? JUMP_SPEED : HI_JUMP_SPEED)); } DDDraw.DrawBegin(Ground.I.Picture.Teki_a03_Jump01, this.X - DDGround.ICamera.X, this.Y - 16 - DDGround.ICamera.Y); DDDraw.DrawZoom_X(this.FacingLeft ? 1.0 : -1.0); DDDraw.DrawEnd(); } this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y + 2.0), 20.0); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { double a_mahoujin = 0.0; for (int frame = 0; ; frame++) { { double rad = frame / 70.0; DDUtils.Approach(ref this.X, GameConsts.FIELD_W / 2 + Math.Sin(rad) * 180.0, 0.93); DDUtils.Approach(ref this.Y, GameConsts.FIELD_H / 7 + Math.Cos(rad) * 50.0, 0.93); } if (30 < frame && frame % 3 == 0) { for (int c = 0; c < 3; c++) { double rad = frame / 27.0 + (Math.PI * 2.0) * c / 3.0; D2Point pt = DDUtils.AngleToPoint(rad, 50.0); EnemyCommon.TAMA_COLOR_e color = new EnemyCommon.TAMA_COLOR_e[] { EnemyCommon.TAMA_COLOR_e.CYAN, EnemyCommon.TAMA_COLOR_e.YELLOW, EnemyCommon.TAMA_COLOR_e.PURPLE, } [c]; Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_01(this.X + pt.X, this.Y + pt.Y, rad + Math.PI / 2.0, color)); Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_01(this.X + pt.X, this.Y + pt.Y, rad - Math.PI / 2.0, color)); } } { const int TRANS_FRAME = 60; if (frame == TRANS_FRAME) { // ボム消し // このフレームにおけるボム当たり判定は既に展開しているので、ボスの当たり判定を展開する前のフレームで消す。 Game.I.Shots.RemoveAll(v => v.Kind == Shot.Kind_e.BOMB); // 念のためリセット //Game.I.BombUsed = false; Game.I.PlayerWasDead = false; } else if (TRANS_FRAME < frame) { DDUtils.Approach(ref a_mahoujin, 1.0, 0.99); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 25.0); } } EnemyCommon_鍵山雛.Draw(this.X, this.Y, true, a_mahoujin); EnemyCommon_鍵山雛.DrawOther(this); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { double a_mahoujin = 0.0; 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 (30 < frame && frame % 3 == 0) { for (int c = 0; c < 2; c++) { double rad = frame / 27.0 + (Math.PI * 2.0) * c / 2.0; D2Point pt = DDUtils.AngleToPoint(rad, 20.0); Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_02(this.X + pt.X, this.Y + pt.Y, rad, 0.9, EnemyCommon.TAMA_COLOR_e.RED)); Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_02(this.X + pt.X, this.Y + pt.Y, rad, 0.0, EnemyCommon.TAMA_COLOR_e.GREEN)); Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_02(this.X + pt.X, this.Y + pt.Y, rad, -0.9, EnemyCommon.TAMA_COLOR_e.BLUE)); } } if (30 < frame && frame % 20 == 0) { for (int c = 0; c < 3; c++) { double rad = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) + (Math.PI * 2.0) * (c * 2 + 1) / 6.0; D2Point pt = DDUtils.AngleToPoint(rad, 50.0); Game.I.Enemies.Add(new Enemy_鍵山雛_Tama_03(this.X, this.Y, rad, EnemyCommon.TAMA_COLOR_e.PINK)); } } { const int TRANS_FRAME = 60; if (frame == TRANS_FRAME) { // ボム消し // このフレームにおけるボム当たり判定は既に展開しているので、ボスの当たり判定を展開する前のフレームで消す。 Game.I.Shots.RemoveAll(v => v.Kind == Shot.Kind_e.BOMB); // 念のためリセット //Game.I.BombUsed = false; Game.I.PlayerWasDead = false; } else if (TRANS_FRAME < frame) { DDUtils.Approach(ref a_mahoujin, 1.0, 0.99); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 25.0); } } EnemyCommon_鍵山雛.Draw(this.X, this.Y, true, a_mahoujin); EnemyCommon_鍵山雛.DrawOther(this); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { while (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))) { this.X += 12.0 * (this.FacingLeft ? -1 : 1); switch (this.Level) { case 1: { DDDraw.DrawCenter(Ground.I.Picture.Shot_Normal, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 10.0); } break; case 2: { const double R = 14.0; DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(R, R); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); } break; case 3: { const double R = 24.0; DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(R, R); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); } break; case 4: { const double R = 48.0; DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(R, R); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); } break; default: throw null; // never } yield return(true); } }
private static void OnibiDraw(FairyInfo fairy, int color) { int koma = (fairy.Frame / 4) % 4; DDDraw.DrawBegin(GetOnibiPicture(color, koma), fairy.Enemy.X, fairy.Enemy.Y); DDDraw.DrawZoom(2.0); DDDraw.DrawEnd(); fairy.Enemy.Crash = DDCrashUtils.Circle(new D2Point(fairy.Enemy.X, fairy.Enemy.Y), 22.0); }
protected override IEnumerable <bool> E_Draw() { for (; ;) { this.X -= 3.0; DDDraw.DrawCenter(Ground.I.Picture.Enemy0001, this.X, this.Y); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 48.0); yield return(!DDUtils.IsOutOfScreen(new D2Point(this.X, this.Y), 48.0)); } }
protected override IEnumerable <bool> E_Draw() { for (; ;) { DDDraw.DrawCenter(this.Picture, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 16.0); yield return(true); } }
private static void BigFairyDraw(FairyInfo fairy, int color) { if (fairy.Frame == 0) // init { fairy.LastX = fairy.Enemy.X; } double xDiff = fairy.Enemy.X - fairy.LastX; fairy.LastX = fairy.Enemy.X; if (fairy.Frame % 7 == 0) { if (Math.Abs(xDiff) < SCommon.MICRO) // ? 左右に動いてない。 { DDUtils.CountDown(ref fairy.XMoveCount); } else if (xDiff < 0.0) // ? 左に動いてる。 { fairy.XMoveCount--; } else // ? 右に動いてる。 { fairy.XMoveCount++; } DDUtils.ToRange(ref fairy.XMoveCount, -2, 2); } int mode = DDUtils.Sign(fairy.XMoveCount); int koma; if (mode != 0) { koma = Math.Abs(fairy.XMoveCount) - 1; } else { koma = (fairy.Frame / 7) % 3; } if (1 <= fairy.Enemy.HP && fairy.Enemy.TransFrame == 0) // ? 無敵ではない。 { DDUtils.Approach(ref fairy.UntransRate, 0.5, 0.92); } DDDraw.SetAlpha(fairy.UntransRate); DDDraw.DrawBegin(Ground.I.Picture2.D_MAHOJIN_HAJIKE_00[5], fairy.Enemy.X, fairy.Enemy.Y); DDDraw.DrawRotate(fairy.Frame / 20.0); DDDraw.DrawZoom(0.4); DDDraw.DrawEnd(); DDDraw.Reset(); DDDraw.DrawCenter(GetBigFairyPicture(color, mode, koma), fairy.Enemy.X, fairy.Enemy.Y); fairy.Enemy.Crash = DDCrashUtils.Circle(new D2Point(fairy.Enemy.X, fairy.Enemy.Y), 30.0); }
protected override IEnumerable <bool> E_Draw() { double r; switch (this.TamaKind) { case EnemyCommon.TAMA_KIND_e.NORMAL: r = 8.0; break; case EnemyCommon.TAMA_KIND_e.BIG: r = 12.0; break; case EnemyCommon.TAMA_KIND_e.LARGE: r = 30.0; break; // TODO: その他の敵弾についてもここへ追加.. default: throw null; // never } double xAdd; double yAdd; DDUtils.MakeXYSpeed(this.X, this.Y, Game.I.Player.X, Game.I.Player.Y, this.Speed, out xAdd, out yAdd); DDUtils.Rotate(ref xAdd, ref yAdd, this.Angle); DDPicture picture = EnemyCommon.GetTamaPicture(this.TamaKind, this.TamaColor); for (; ;) { this.X += xAdd; this.Y += yAdd; DDDraw.DrawCenter(picture, this.X, this.Y); if (this.AbsorbableWeapon != -1) // ? 吸収可能 { DDDraw.SetAlpha(0.5); DDDraw.SetBright(0.0, 0.5, 1.0); DDDraw.DrawBegin(Ground.I.Picture2.D_MAHOJIN_HAJIKE_00[5], this.X, this.Y); DDDraw.DrawRotate(DDEngine.ProcFrame / 30.0); DDDraw.DrawZoom(0.5); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetPrint((int)this.X, (int)this.Y); DDPrint.SetBorder(new I3Color(0, 0, 100)); DDPrint.Print("[" + this.AbsorbableWeapon + "]"); DDPrint.Reset(); } this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), r); yield return(!EnemyCommon.IsEvacuated(this)); } }
protected override IEnumerable <bool> E_Draw() { // ---- game_制御 ---- Ground.I.Music.神さびた古戦場.Play(); // ---- int boss_rot = 0; double boss_approach_rate = 1.0; for (int frame = 0; ; frame++) { if (!_hitBack()) { double x = Math.Cos(boss_rot / 100.0); double y = Math.Sin(boss_rot / 100.0); boss_rot++; x *= 0.4; y *= 0.4; x += 0.5; y += 0.5; x *= Game.I.Map.W * GameConsts.TILE_W; y *= Game.I.Map.H * GameConsts.TILE_H; DDUtils.Approach(ref this.X, x, boss_approach_rate); DDUtils.Approach(ref this.Y, y, boss_approach_rate); DDUtils.Approach(ref boss_approach_rate, 0.97, 0.99); if (frame % 30 == 0) { Game.I.Enemies.Add(new Enemy_B神奈子_Tama(this.X, this.Y)); } 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(); } this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 80.0); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { for (; ;) { double speed = 8.0; double nanameSpeed = speed / Consts.ROOT_OF_2; switch (this.Direction) { case 4: this.X -= speed; break; case 6: this.X += speed; break; case 8: this.Y -= speed; break; case 2: this.Y += speed; break; case 1: this.X -= nanameSpeed; this.Y += nanameSpeed; break; case 3: this.X += nanameSpeed; this.Y += nanameSpeed; break; case 7: this.X -= nanameSpeed; this.Y -= nanameSpeed; break; case 9: this.X += nanameSpeed; this.Y -= nanameSpeed; break; default: throw null; // never } DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawZoom(0.1); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 5.0); yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))); // カメラの外に出たら(画面から見えなくなったら)消滅する。 } }
protected override IEnumerable <bool> E_Draw() { while (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y))) { this.X += 12.0 * (this.FacingLeft ? -1 : 1); DDDraw.DrawBegin(Ground.I.Picture.Shot_Normal, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 10.0); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { for (; ;) { this.X += 8.0 * (this.FacingLeft ? -1 : 1); DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawZoom(0.1); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 5.0); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { for (; ;) { this.X += 10; DDDraw.SetAlpha(0.5); DDDraw.DrawCenter(Ground.I.Picture.Shot0001, this.X, this.Y); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 16.0); yield return(!DDUtils.IsOutOfScreen(new D2Point(this.X, this.Y), 16.0)); } }
/// <summary> /// 当たり判定を配置する。 /// 処理すべきこと: /// Game.I.PlayerCrashes への追加 /// Game.I.GrazeCrashes への追加 /// </summary> public void Put当たり判定() { const double GRAZE_R = 10.0; foreach (DDScene scene in DDSceneUtils.Create(5)) { D2Point pt = DDUtils.AToBRate( new D2Point(this.X, this.Y), new D2Point(this.LastX, this.LastY), scene.Rate ); Game.I.PlayerCrashes.Add(DDCrashUtils.Point(pt)); Game.I.GrazeCrashes.Add(DDCrashUtils.Circle(pt, GRAZE_R)); } }
protected override IEnumerable <bool> E_Draw() { D2Point speed = DDUtils.AngleToPoint(DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y), 8.0); for (; ;) { this.X += speed.X; this.Y += speed.Y; DDDraw.DrawCenter(Ground.I.Picture.Tama0001, this.X, this.Y); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 16.0); yield return(!DDUtils.IsOutOfScreen(new D2Point(this.X, this.Y), 16.0)); } }
protected override IEnumerable <bool> E_Draw() { for (int frame = 0; ; frame++) { this.X += this.Speed.X; this.Y += this.Speed.Y; if (this.X < 0.0) { this.Speed.X = Math.Abs(this.Speed.X); } else if (GameConsts.FIELD_W < this.X) { this.Speed.X = -Math.Abs(this.Speed.X); } if (this.Y < 0.0) { this.Speed.Y = Math.Abs(this.Speed.Y); } else { this.Speed.Y += 0.03; // 重力加速度 } if (this.AbsorbableWeapon != -1) // ? 吸収可能 { DDDraw.SetAlpha(0.2); DDDraw.SetBright(0.0, 0.5, 1.0); DDDraw.DrawBegin(Ground.I.Picture2.D_MAHOJIN_HAJIKE_00[5], this.X, this.Y); DDDraw.DrawRotate(DDEngine.ProcFrame / 30.0); DDDraw.DrawZoom(1.2); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetPrint((int)this.X, (int)this.Y); DDPrint.SetBorder(new I3Color(0, 0, 100)); DDPrint.Print("[" + this.AbsorbableWeapon + "]"); DDPrint.Reset(); } DDDraw.DrawCenter(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.DOUBLE, this.Color), this.X, this.Y); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 6.0); yield return(this.Y < GameConsts.FIELD_H); } }
protected override IEnumerable <bool> E_Draw() { D2Point speed = DDUtils.AngleToPoint(this.Rad + this.RadZure, 3.0); for (int frame = 0; frame < 90; frame++) { speed *= 0.95; this.X += speed.X; this.Y += speed.Y; DDDraw.DrawBegin(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.NORMAL, this.Color), this.X, this.Y); DDDraw.DrawRotate(this.Rad + Math.PI / 2.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 6.0); yield return(true); } { double xa; double ya; DDUtils.MakeXYSpeed(this.X, this.Y, Game.I.Player.X, Game.I.Player.Y, 3.0, out xa, out ya); DDUtils.Rotate(ref xa, ref ya, this.RadZure); speed.X = xa; speed.Y = ya; } for (; ;) { this.X += speed.X; this.Y += speed.Y; DDDraw.DrawBegin(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.NORMAL, this.Color), this.X, this.Y); DDDraw.DrawRotate(this.Rad + Math.PI / 2.0); DDDraw.DrawEnd(); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 6.0); yield return(!EnemyCommon.IsEvacuated(this)); } }
protected override IEnumerable <bool> E_Draw() { const double CHARA_R = 20.0; for (int frame = 0; ; frame++) { while (DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), CHARA_R)) // 画面外に居るときは休止する。 { yield return(true); } double xa; double ya; DDUtils.MakeXYSpeed(this.X, this.Y, Game.I.Player.X, Game.I.Player.Y, 0.5, out xa, out ya); this.X += xa; this.Y += ya; if (frame != 0 && frame % 240 == 0) { Game.I.Enemies.Add(Enemy_弾.Create自機狙い(this.X, this.Y, 3.0)); } //if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), CHARA_R * 1.2)) // 画面外では休止 { // 暫定_描画 { DDDraw.SetBright(new I3Color(200, 200, 0)); DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y); DDDraw.DrawSetSize(CHARA_R * 2, CHARA_R * 2); DDDraw.DrawEnd(); DDDraw.Reset(); DDPrint.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y); DDPrint.SetBorder(new I3Color(0, 0, 0)); DDPrint.Print("[チェーサー_" + this.HP + "]"); DDPrint.Reset(); } this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), CHARA_R); } yield return(true); } }
protected override IEnumerable <bool> E_Draw() { for (; ;) { this.X += this.XAdd; this.Y += this.YAdd; this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), R); DDDraw.SetBright(new I3Color(255, 64, 255)); DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X, this.Y); DDDraw.DrawSetSize(R * 2, R * 2); DDDraw.DrawEnd(); DDDraw.Reset(); yield return(true); } }
protected override IEnumerable <bool> E_Draw() { D2Point speed = GameCommon.GetXYSpeed(this.Direction, 10.0); for (int frame = 0; ; frame++) { this.X += speed.X; this.Y += speed.Y; DDDraw.DrawBegin(Ground.I.Picture.Dummy, 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 dc_r = Ground.I.Picture2.D_DECOCIRCLE.Get_W() / 2.0; double dc_z = BOMB_R / dc_r; Func <bool>[] circles = new Func <bool>[] { SCommon.Supplier(this.Circle( 0.75, dc_z, 0.1, 0.05 )), SCommon.Supplier(this.Circle( 0.25, dc_z * 0.75, dc_z * 2.0, 0.01 )), SCommon.Supplier(this.Circle( 0.5, dc_z * 0.5, 0.1, -0.02 )), }; for (int frame = 0; frame < GameConsts.PLAYER_BOMB_FRAME_MAX + 60; frame++) { this.Y -= frame / 60.0; foreach (Func <bool> circle in circles) { circle(); } this.Crash = DDCrashUtils.Circle( new D2Point(this.X, this.Y), BOMB_R ); yield return(true); } }
private void P_Draw() { if (this.Friend == null) { this.Friend = this.GetFriend(); } else { if (this.Friend.HP == -1) { Game.I.Enemies.Add(new Enemy_B0003_Egg(this.X, this.Y, this.Friend.X, this.Friend.Y)); this.Friend = null; } } if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)) { double xBure = Math.Cos(this.Frame / 10.0) * 5.0; double yBure = Math.Sin(this.Frame / 10.0) * 5.0; DDDraw.DrawCenter( Ground.I.Picture.Enemy_B0003, this.X - DDGround.ICamera.X + xBure, this.Y - DDGround.ICamera.Y + yBure ); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 50.0); } // 最初の数フレーム間は無敵とする。 // -- 再生後即死亡すると仲間に補足されず、次の再生が行われなくなってしまう。-- 1,2フレーム生き延びるだけで十分かもしれない。 { if (this.Frame == 0) { this.HP = 0; // 無敵 } if (this.Frame == 5) { this.HP = 1; // 無敵解除 } } this.Frame++; }
protected override IEnumerable <bool> E_Draw() { D2Point speed = GameCommon.GetXYSpeed(this.Direction, 8.0); int bouncedCount = 0; for (int frame = 0; ; frame++) { this.X += speed.X; this.Y += speed.Y; if (this.壁をすり抜ける) // ? 跳ね返り可能 { bool bounced = false; if (this.IsInsideWall(-10, 0) || this.IsInsideWall(10, 0)) { speed.X *= -1.0; bounced = true; } if (this.IsInsideWall(0, -10) || this.IsInsideWall(0, 10)) { speed.Y *= -1.0; bounced = true; } if (bounced) { DDGround.EL.Add(SCommon.Supplier(Effects.跳ねた(this.X, this.Y))); bouncedCount++; if (BOUNCE_MAX <= bouncedCount) { this.壁をすり抜ける = false; } } } DDDraw.DrawBegin(Ground.I.Picture2.IconSet[0, 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))); // カメラの外に出たら(画面から見えなくなったら)消滅する。 } }