Exemple #1
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);
            }
        }
Exemple #2
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));
            }
        }
Exemple #3
0
        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));
            }
        }
Exemple #4
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (int frame = 0; ; frame++)
            {
                if (DDUtils.IsOut(new D2Point(this.X, this.Y), new D4Rect(0, 0, GameConsts.FIELD_W, GameConsts.FIELD_H)))
                {
                    break;
                }

                this.X += this.Speed.X;
                this.Y += this.Speed.Y;

                DDDraw.DrawBegin(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.DOUBLE, this.Color), this.X, this.Y);
                DDDraw.DrawEnd();

                Game.I.EL_AfterDrawWalls.Add(SCommon.Supplier(this.E_魔法陣_1(this.X, this.Y)));

                this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 6.0);

                yield return(true);
            }

            Game.I.EL_AfterDrawWalls.Add(SCommon.Supplier(this.E_魔法陣_V(this.X, this.Y)));

            {
                const double SPEED = 3.0;

                if (this.X < 0.0)                 // ? フィールド左側に衝突
                {
                    this.Speed = new D2Point(SPEED, 0.0);
                    this.Color = EnemyCommon.TAMA_COLOR_e.YELLOW;
                }
                else if (GameConsts.FIELD_W < this.X)                 // ? フィールド右側に衝突
                {
                    this.Speed = new D2Point(-SPEED, 0.0);
                    this.Color = EnemyCommon.TAMA_COLOR_e.YELLOW;
                }
                else if (this.Y < 0.0)                 // ? フィールド上側に衝突
                {
                    this.Speed = new D2Point(0.0, SPEED);
                    this.Color = EnemyCommon.TAMA_COLOR_e.ORANGE;
                }
                else                 // ? フィールド下側に衝突
                {
                    this.Speed = new D2Point(0.0, -SPEED);
                    this.Color = EnemyCommon.TAMA_COLOR_e.ORANGE;
                }
            }

            for (int frame = 0; ; frame++)
            {
                this.X += this.Speed.X;
                this.Y += this.Speed.Y;

#if true
                // 他の敵弾より上に(後に)描画する。
                // -- 見えやすいように
                //
                Game.I.EnemyEffects.Add(() =>
                {
                    DDDraw.DrawCenter(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.DOUBLE, this.Color), this.X, this.Y);
                    return(false);
                });
#else // old
                DDDraw.DrawCenter(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.DOUBLE, this.Color), this.X, this.Y);
#endif

                this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), 6.0);

                yield return(!EnemyCommon.IsEvacuated(this));
            }
        }