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() { 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); } }
public void Loaded(Tools.D2Point pt) { this.X = pt.X; this.Y = pt.Y; D2Point mvPt = DDUtils.AngleToPoint( DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y), 8.0 ); this.XAdd = mvPt.X; this.YAdd = mvPt.Y; }
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() { 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() { for (int frame = 0; ; frame++) { 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); if (DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) < 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)) { { double xZoom = this.Speed.X < 0.0 ? -1.0 : 1.0; DDDraw.DrawBegin( new DDPicture[] { Ground.I.Picture.Enemy_B0001_01, Ground.I.Picture.Enemy_B0001_02, Ground.I.Picture.Enemy_B0001_03, Ground.I.Picture.Enemy_B0001_04, } [frame / 5 % 4], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); } // 当たり判定ナシ } yield return(true); } }
public bool EachFrame() { double rot = DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y); rot += DDUtils.Random.Real2() * 0.05; D2Point speedAdd = DDUtils.AngleToPoint(rot, 0.1); if (DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) < 50.0) { speedAdd *= -300.0; } this.Speed += speedAdd; this.Speed *= 0.93; this.X += this.Speed.X; this.Y += this.Speed.Y; return(true); }
public bool EachFrame() { this.Frame++; if (this.Frame % 20 == 0) { Game.I.AddEnemy(IEnemies.Load(new Tama0001(), this.X, this.Y)); } D2Point mvPt = DDUtils.AngleToPoint( DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y), 2.5 ); this.X += mvPt.X; this.Y += mvPt.Y; return(DDUtils.IsOutOfScreen(new D2Point(this.X, this.Y), 64.0) == false); }
protected override IEnumerable <bool> E_Draw() { D2Point speed = DDUtils.AngleToPoint(this.Rad, 3.0); for (; ;) { this.X += speed.X; this.Y += speed.Y; DDDraw.DrawBegin(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.KNIFE, this.Color), this.X, this.Y); DDDraw.DrawZoom(2.0); 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)); } }
private void P_Draw() { 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); if (DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) < 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)) { { double xZoom = this.Speed.X < 0.0 ? -1.0 : 1.0; DDDraw.DrawBegin( new DDPicture[] { Ground.I.Picture.Enemy_B0001_01, Ground.I.Picture.Enemy_B0001_02, Ground.I.Picture.Enemy_B0001_03, Ground.I.Picture.Enemy_B0001_04, } [this.Frame / 5 % 4], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y ); DDDraw.DrawZoom_X(xZoom); DDDraw.DrawEnd(); } // 当たり判定ナシ } this.Frame++; }
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 (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; } }
protected override IEnumerable <bool> E_Draw() { for (int frame = 1; ; frame++) { if (frame % 20 == 0) { Game.I.Enemies.Add(new Enemy_BTama0001(this.X, this.Y)); } D2Point speed = DDUtils.AngleToPoint( DDUtils.GetAngle(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y), 2.5 ); this.X += speed.X; this.Y += speed.Y; DDDraw.DrawCenter(Ground.I.Picture.Enemy0002, this.X, this.Y); this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 64.0); yield return(true); // 自機をホーミングするので、画面外に出て行かない。 } }
public Enemy_鍵山雛_Tama_03(double x, double y, double rad, EnemyCommon.TAMA_COLOR_e color) : base(x, y, Kind_e.TAMA, 0, 0) { this.Speed = DDUtils.AngleToPoint(rad, 1.0); this.Color = color; }
protected override IEnumerable <bool> E_Draw() { for (; ;) { if (this.TargetEnemy == null || this.TargetEnemy.HP == -1) // ? ターゲットしていない || ターゲットが死亡した。 { this.TargetEnemy = this.FindTargetEnemy(); } if (this.TargetEnemy != null) { double targetRot = DDUtils.GetAngle(new D2Point(this.TargetEnemy.X, this.TargetEnemy.Y) - new D2Point(this.X, this.Y)); double diffRot = targetRot - this.Rot; { const double ROT_ADD = 0.3; if (diffRot < -Math.PI || 0.0 < diffRot && diffRot < Math.PI) { this.Rot += ROT_ADD; } else { this.Rot -= ROT_ADD; } } { const double ROT_MAX = Math.PI * 2.0; this.Rot += ROT_MAX; while (ROT_MAX < this.Rot) { this.Rot -= ROT_MAX; } } } { const double SPEED = 20.0; D2Point movePt = DDUtils.AngleToPoint(this.Rot, SPEED); this.X += movePt.X; this.Y += movePt.Y; } DDDraw.SetAlpha(ShotConsts.A); DDDraw.SetBright(0.0, 1.0, 1.0); DDDraw.DrawBegin(Ground.I.Picture2.D_LASER, this.X, this.Y); DDDraw.DrawZoom(1.5); DDDraw.DrawRotate(this.Rot - Math.PI * 1.5); DDDraw.DrawEnd(); DDDraw.Reset(); this.Crash = DDCrashUtils.Circle( new D2Point(this.X, this.Y), 40.0 ); yield return(!DDUtils.IsOut(new D2Point(this.X, this.Y), new D4Rect(0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H), 100.0)); } }
public Enemy_ルーミア_Tama_03(double x, double y, double rad, EnemyCommon.TAMA_COLOR_e color, int absorbableWeapon = -1) : base(x, y, Kind_e.TAMA, 0, 0, absorbableWeapon) { this.Speed = DDUtils.AngleToPoint(rad, 6.0); this.Color = color; }