Пример #1
0
        public static void EachFrame(DDSubScreen targetScreen)
        {
            // 固定効果有り
            //if (波紋s.Count == 0)
            //    return;

            for (int x = 0; x <= PIECES_W; x++)
            {
                for (int y = 0; y <= PIECES_H; y++)
                {
                    PointTable[x, y] = new D2Point(x * PIECE_WH, y * PIECE_WH);
                }
            }

            固定効果();
            波紋s.ExecuteAllTask();

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    PieceTable[x, y].ChangeDrawScreen();

                    DX.DrawRectGraph(0, 0, x * PIECE_WH, y * PIECE_WH, (x + 1) * PIECE_WH, (y + 1) * PIECE_WH, targetScreen.GetHandle(), 0);
                }
            }

            Screen.ChangeDrawScreen();

            // フィールドの淵がめくれないように
            for (int x = 0; x <= PIECES_W; x++)
            {
                DDUtils.Minim(ref PointTable[x, 0].Y, 0.0);
                DDUtils.Maxim(ref PointTable[x, PIECES_H].Y, GameConsts.FIELD_H);
            }
            for (int y = 0; y <= PIECES_H; y++)
            {
                DDUtils.Minim(ref PointTable[0, y].X, 0.0);
                DDUtils.Maxim(ref PointTable[PIECES_W, y].X, GameConsts.FIELD_W);
            }

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    D2Point lt = PointTable[x + 0, y + 0];
                    D2Point rt = PointTable[x + 1, y + 0];
                    D2Point rb = PointTable[x + 1, y + 1];
                    D2Point lb = PointTable[x + 0, y + 1];

                    DDDraw.SetIgnoreError();
                    DDDraw.DrawFree(PieceTable[x, y].ToPicture(), lt, rt, rb, lb);
                    DDDraw.Reset();
                }
            }

            targetScreen.ChangeDrawScreen();

            DDDraw.DrawSimple(Screen.ToPicture(), 0, 0);
        }
        protected override void Invoke_02(string command, params string[] arguments)
        {
            int c = 0;

            if (command == ScenarioWords.COMMAND_画像)
            {
                int index = int.Parse(arguments[c++]);

                if (index < 0 || this.Images.Length <= index)
                {
                    throw new DDError("Bad index: " + index);
                }

                this.ImageIndex    = index;
                this.ImageDrawSize = DDUtils.AdjustRectExterior(this.Images[index].GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H)).Size;
                this.ImageLTStart  = new D2Point(DDConsts.Screen_W - this.ImageDrawSize.W, DDConsts.Screen_H - this.ImageDrawSize.H);
                //this.ImageLTEnd = new D2Point(0, 0); // 固定値なので更新しない。
            }
            else if (command == ScenarioWords.COMMAND_Slide)
            {
                double rate1 = double.Parse(arguments[c++]);
                double rate2 = double.Parse(arguments[c++]);

                rate1 = DoubleTools.ToRange(rate1, 0.0, 1.0);
                rate2 = DoubleTools.ToRange(rate2, 0.0, 1.0);

                this.CurrDrawPosRate = rate1;
                this.DestDrawPosRate = rate2;
            }
            else
            {
                throw new DDError();
            }
        }
Пример #3
0
 public static D2Point Slide(D2Point start, D2Point end, double rate)
 {
     return(new D2Point(
                Slide(start.X, end.X, rate),
                Slide(start.Y, end.Y, rate)
                ));
 }
Пример #4
0
        private static D2Point 固定効果_GetShift(D2Point pt)
        {
            D2Point ptShift = new D2Point(0, 0);

            if (Ground.I.自弾背景歪み)
            {
                foreach (Shot shot in Game.I.Shots.Iterate())
                {
                    D2Point shotPt   = new D2Point(shot.X, shot.Y);
                    double  distance = DDUtils.GetDistance(pt, shotPt);

                    if (distance < 100.0)
                    {
                        // To 0.0 ~ 1.0
                        distance /= 100.0;
                        distance  = 1.0 - distance;

                        ptShift.X += (shot.X - shot.LastX) * distance * shot.AttackPoint * 0.01;
                        ptShift.Y += (shot.Y - shot.LastY) * distance * shot.AttackPoint * 0.01;
                    }
                }
            }

            // 新しい効果をここへ追加..

            return(ptShift);
        }
Пример #5
0
 public Enemy_Pata(D2Point pos, double speed)
     : base(pos)
 {
     this.XSpeed    = speed;
     this.YSpeed    = 0.0;
     this.Highest_Y = pos.Y;
 }
Пример #6
0
        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);
            }
        }
Пример #7
0
        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);
            }
        }
Пример #8
0
 public static DDCrash Point(D2Point pt)
 {
     return(new DDCrash()
     {
         Kind = Kind_e.POINT,
         Pt = pt,
     });
 }
Пример #9
0
        public override void Damaged(Shot shot)
        {
            // 難読化のため #if の入れ子が出来ない。
#if true
            // 後退は不要
#elif true
            // 被弾した武器の進行方向へ後退する。
            {
                D2Point speed = Common.GetSpeed(shot.Direction, 10.0);

                this.X += speed.X;
                this.Y += speed.Y;
            }
#else
            // 被弾した武器の進行方向へ後退する。
            {
                const double SPAN        = 10.0;
                const double NANAME_SPAN = 7.0;

                switch (shot.Direction)
                {
                case 4: this.X -= SPAN; break;

                case 6: this.X += SPAN; break;

                case 8: this.Y -= SPAN; break;

                case 2: this.Y += SPAN; break;

                case 1:
                    this.X -= NANAME_SPAN;
                    this.Y += NANAME_SPAN;
                    break;

                case 3:
                    this.X += NANAME_SPAN;
                    this.Y += NANAME_SPAN;
                    break;

                case 7:
                    this.X -= NANAME_SPAN;
                    this.Y -= NANAME_SPAN;
                    break;

                case 9:
                    this.X += NANAME_SPAN;
                    this.Y -= NANAME_SPAN;
                    break;

                default:
                    throw null;                             // never
                }
            }
#endif

            this.HitBackFrame = 1;
            base.Damaged(shot);
        }
Пример #10
0
 public static DDCrash Circle(D2Point pt, double r)
 {
     return(new DDCrash()
     {
         Kind = Kind_e.CIRCLE,
         Pt = pt,
         R = r,
     });
 }
Пример #11
0
        /// <summary>
        /// よく使っていた古い関数
        /// 始点から終点へ指定速度で向かう場合の(単位時間の)移動量を返す。
        /// </summary>
        /// <param name="x">始点X</param>
        /// <param name="y">始点Y</param>
        /// <param name="targetX">終点X</param>
        /// <param name="targetY">終点Y</param>
        /// <param name="speed">速度</param>
        /// <param name="xa">移動量X</param>
        /// <param name="ya">移動量Y</param>
        public static void MakeXYSpeed(double x, double y, double targetX, double targetY, double speed, out double xa, out double ya)
        {
            D2Point pt = new D2Point(targetX - x, targetY - y);

            pt = AngleToPoint(GetAngle(pt), speed);

            xa = pt.X;
            ya = pt.Y;
        }
Пример #12
0
        public void ShouldAcceptPositiveValue()
        {
            IPoint d1Point;
            IPoint d2Point;
            IPoint d3Point;

            Assert.DoesNotThrow(() => d1Point = new D1Point(5));
            Assert.DoesNotThrow(() => d2Point = new D2Point(5, 6));
            Assert.DoesNotThrow(() => d3Point = new D3Point(5, 6, 7));
        }
Пример #13
0
        public static void Rotate(ref double x, ref double y, D2Point origin, double rot)
        {
            x -= origin.X;
            y -= origin.Y;

            Rotate(ref x, ref y, rot);

            x += origin.X;
            y += origin.Y;
        }
Пример #14
0
        public static Enemy_弾 Create何か狙い(double x, double y, D2Point targetPt, double speed, double rot = 0.0)
        {
            double xa;
            double ya;

            DDUtils.MakeXYSpeed(x, y, targetPt.X, targetPt.Y, speed, out xa, out ya);
            DDUtils.Rotate(ref xa, ref ya, rot);

            return(new Enemy_弾(x, y, xa, ya));
        }
Пример #15
0
        public void ShouldThrowExceptionOnNegativeValue()
        {
            IPoint d1Point;
            IPoint d2Point;
            IPoint d3Point;

            Assert.That(() => d1Point = new D1Point(-5), Throws.TypeOf <InvalidPointException>());
            Assert.That(() => d2Point = new D2Point(-6, 5), Throws.TypeOf <InvalidPointException>());
            Assert.That(() => d3Point = new D3Point(-7, -2, 1), Throws.TypeOf <InvalidPointException>());
        }
Пример #16
0
        // ===========================
        // ==== Map 関連 (ここまで) ====
        // ===========================

        public static bool 壁処理(ref double x, ref double y, D2Point[] crashPts)
        {
            D2Point pt = new D2Point(x, y);

            bool ret = 壁処理(ref pt, crashPts);

            x = pt.X;
            y = pt.Y;

            return(ret);
        }
Пример #17
0
 public static void INIT()
 {
     for (int x = 0; x < PIECES_W; x++)
     {
         for (int y = 0; y < PIECES_H; y++)
         {
             PieceTable[x, y]       = new DDSubScreen(PIECE_WH, PIECE_WH);
             ReverbShiftTable[x, y] = new D2Point(0, 0);
         }
     }
 }
Пример #18
0
        private static void DrawToScreen(DDSubScreen screen, Map map, D2Point mapCamera)
        {
            int cam_l = (int)mapCamera.X;
            int cam_t = (int)mapCamera.Y;
            int cam_r = cam_l + DDConsts.Screen_W;
            int cam_b = cam_t + DDConsts.Screen_H;

            int l = cam_l / GameConsts.TILE_W;
            int t = cam_t / GameConsts.TILE_H;
            int r = cam_r / GameConsts.TILE_W;
            int b = cam_b / GameConsts.TILE_H;

            using (screen.Section())
            {
                DX.ClearDrawScreen();

                {
                    Map     bk_map     = Game.I.Map;
                    D2Point bk_camera  = DDGround.Camera;
                    I2Point bk_iCamera = DDGround.ICamera;

                    // Hack
                    {
                        Game.I.Map       = map;
                        DDGround.Camera  = new D2Point(cam_l, cam_t);
                        DDGround.ICamera = new I2Point(cam_l, cam_t);
                    }

                    WallCreator.Create(map.WallName).Draw();

                    // restore
                    {
                        Game.I.Map       = bk_map;
                        DDGround.Camera  = bk_camera;
                        DDGround.ICamera = bk_iCamera;
                    }
                }

                DDGround.EL.Clear();

                for (int x = l; x <= r; x++)
                {
                    for (int y = t; y <= b; y++)
                    {
                        double cell_x = x * GameConsts.TILE_W + GameConsts.TILE_W / 2;
                        double cell_y = y * GameConsts.TILE_H + GameConsts.TILE_H / 2;

                        map.GetCell(x, y).Tile.Draw(cell_x - cam_l, cell_y - cam_t, x, y);
                    }
                }

                DDGround.EL.ExecuteAllTask();                 // 前面に表示するタイルのため
            }
        }
Пример #19
0
        public static void EachFrame()
        {
            if (抑止)
            {
                return;
            }

            if (波紋s.Count == 0)
            {
                return;
            }

            for (int x = 0; x <= PIECES_W; x++)
            {
                for (int y = 0; y <= PIECES_H; y++)
                {
                    PointTable[x, y] = new D2Point(x * PIECE_WH, y * PIECE_WH);
                }
            }

            波紋s.ExecuteAllTask();

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    PieceTable[x, y].ChangeDrawScreen();

                    DX.DrawRectGraph(0, 0, x * PIECE_WH, y * PIECE_WH, (x + 1) * PIECE_WH, (y + 1) * PIECE_WH, DDGround.MainScreen.GetHandle(), 0);
                }
            }

            Screen.ChangeDrawScreen();

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    D2Point lt = PointTable[x + 0, y + 0];
                    D2Point rt = PointTable[x + 1, y + 0];
                    D2Point rb = PointTable[x + 1, y + 1];
                    D2Point lb = PointTable[x + 0, y + 1];

                    DDDraw.SetIgnoreError();
                    DDDraw.DrawFree(PieceTable[x, y].ToPicture(), lt, rt, rb, lb);
                    DDDraw.Reset();
                }
            }

            DDGround.MainScreen.ChangeDrawScreen();

            DDDraw.DrawSimple(Screen.ToPicture(), 0, 0);
        }
Пример #20
0
            private D2Point 波紋効果による頂点の移動(D2Point pt, double rate)
            {
                // pt == 画面上の座標

                // マップ上の座標に変更
                pt.X += DDGround.ICamera.X;
                pt.Y += DDGround.ICamera.Y;

                // 波紋の中心からの相対座標に変更
                pt.X -= this.Center_X;
                pt.Y -= this.Center_Y;

                //double wave_r = rate * 6000.0;
                double wave_r   = rate * 5000.0 + rate * rate * 1000.0;
                double distance = DDUtils.GetDistance(pt);
                double d        = distance;

                d -= wave_r;

                // d の -(50 + a) ~ (50 + a) を 0.0 ~ 1.0 にする。
                d /= 50.0;
                //d /= 50.0 + rate * 50.0;
                //d /= 50.0 + rate * 100.0; // ガクガクする。
                //d /= 50.0 + rate * 150.0; // ガクガクする。
                d += 1.0;
                d /= 2.0;

                if (0.0 < d && d < 1.0)
                {
                    d *= 2.0;

                    if (1.0 < d)
                    {
                        d = 2.0 - d;
                    }

                    distance += DDUtils.SCurve(d) * 50.0;
                    //distance += DDUtils.SCurve(d) * 50.0 * (1.0 - rate * 0.5); // 弱めるとガクガクする。

                    DDUtils.MakeXYSpeed(0.0, 0.0, pt.X, pt.Y, distance, out pt.X, out pt.Y);                     // distance を pt に反映する。
                }

                // restore -- 波紋の中心からの相対座標 -> マップ上の座標
                pt.X += this.Center_X;
                pt.Y += this.Center_Y;

                // restore -- マップ上の座標 -> 画面上の座標
                pt.X -= DDGround.ICamera.X;
                pt.Y -= DDGround.ICamera.Y;

                return(pt);
            }
Пример #21
0
        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;
        }
Пример #22
0
        public static string GetName(D2Point pt, string defval = null)
        {
            DDCrash ptCrash = DDCrashUtils.Point(pt);

            foreach (NamedCrash crash in Crashes)
            {
                if (crash.Crash.IsCrashed(ptCrash))
                {
                    return(crash.Name);
                }
            }

            return(defval);
        }
Пример #23
0
        private static void 固定効果()
        {
            for (int x = 0; x <= PIECES_W; x++)
            {
                for (int y = 0; y <= PIECES_H; y++)
                {
                    D2Point pt      = new D2Point(x * PIECE_WH, y * PIECE_WH);
                    D2Point ptShift = 固定効果_GetShift(pt);

                    ReverbShiftTable[x, y] += ptShift;
                    ReverbShiftTable[x, y] *= 0.9;

                    PointTable[x, y] += ReverbShiftTable[x, y];
                }
            }
        }
Пример #24
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));
            }
        }
Пример #25
0
        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));
            }
        }
Пример #26
0
        public Enemy_Meteor(D2Point pos)
            : base(pos)
        {
            this.Angle = DDUtils.GetAngle(Game.I.Player.X - pos.X, Game.I.Player.Y - pos.Y);
            this.Speed = 0.0;

            {
                int clr = DDUtils.Random.GetInt(192);
                this.Color = new I3Color(255, clr, clr);
            }

            this.Rot       = 0.0;
            this.RotAdd    = 0.0;
            this.RotAddAdd = DDUtils.Random.DReal() * 0.001;

            DDGround.EL.Add(SCommon.Supplier(this.E_出現エフェクト()));
        }
Пример #27
0
        public Enemy_Arkanoid(D2Point pos, int initDirection)
            : base(pos)
        {
            {
                int xa;
                int ya;

                switch (initDirection)
                {
                case 4: xa = -1; ya = 0; break;

                case 6: xa = 1; ya = 0; break;

                case 8: xa = 0; ya = -1; break;

                case 2: xa = 0; ya = 1; break;

                case 1: xa = -1; ya = 1; break;

                case 7: xa = -1; ya = -1; break;

                case 3: xa = 1; ya = 1; break;

                case 9: xa = 1; ya = -1; break;

                default:
                    throw null;                             // never
                }
                this.XAddSign = xa;
                this.YAddSign = ya;
            }

            {
                const double SPEED        = 3.19921875;          // オリジナルの 3.2 に近い有限桁の値 == 11.00110011(2)
                const double NANAME_SPEED = 2.5;

                if (this.XAddSign * this.YAddSign == 0)
                {
                    this.Speed = SPEED;
                }
                else
                {
                    this.Speed = NANAME_SPEED;
                }
            }
        }
Пример #28
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));
            }
        }
Пример #29
0
        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)));                // カメラの外に出たら(画面から見えなくなったら)消滅する。
            }
        }
Пример #30
0
        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);
            }
        }