コード例 #1
0
        protected override IEnumerable <bool> E_Draw()
        {
            Func <bool> f_移動 = SCommon.Supplier(this.移動());
            Func <bool> f_攻撃 = SCommon.Supplier(this.攻撃());

            for (; ;)
            {
                f_移動();
                f_攻撃();

                DDDraw.DrawCenter(Ground.I.Picture.Boss0001, this.X, this.Y);

                {
                    const double WH       = 192.0;
                    const double CORNER_R = 30.0;

                    this.Crash = DDCrashUtils.Multi(
                        DDCrashUtils.Rect(new D4Rect(
                                              this.X - WH / 2.0 + CORNER_R,
                                              this.Y - WH / 2.0,
                                              WH - CORNER_R * 2.0,
                                              WH
                                              )),
                        DDCrashUtils.Rect(new D4Rect(
                                              this.X - WH / 2.0,
                                              this.Y - WH / 2.0 + CORNER_R,
                                              WH,
                                              WH - CORNER_R * 2.0
                                              )),
                        DDCrashUtils.Circle(new D2Point(this.X - (WH / 2.0 - CORNER_R), this.Y - (WH / 2.0 - CORNER_R)), CORNER_R),
                        DDCrashUtils.Circle(new D2Point(this.X + (WH / 2.0 - CORNER_R), this.Y - (WH / 2.0 - CORNER_R)), CORNER_R),
                        DDCrashUtils.Circle(new D2Point(this.X + (WH / 2.0 - CORNER_R), this.Y + (WH / 2.0 - CORNER_R)), CORNER_R),
                        DDCrashUtils.Circle(new D2Point(this.X - (WH / 2.0 - CORNER_R), this.Y + (WH / 2.0 - CORNER_R)), CORNER_R)
                        );
                }

                yield return(true);
            }
        }
コード例 #2
0
ファイル: Boss0001.cs プロジェクト: stackprobe/G4YokoShoot
        public DDCrash GetCrash()
        {
            const double WH       = 192.0;
            const double CORNER_R = 30.0;

            return(DDCrashUtils.Multi(
                       DDCrashUtils.Rect(new D4Rect(
                                             this.X - WH / 2.0 + CORNER_R,
                                             this.Y - WH / 2.0,
                                             WH - CORNER_R * 2.0,
                                             WH
                                             )),
                       DDCrashUtils.Rect(new D4Rect(
                                             this.X - WH / 2.0,
                                             this.Y - WH / 2.0 + CORNER_R,
                                             WH,
                                             WH - CORNER_R * 2.0
                                             )),
                       DDCrashUtils.Circle(new D2Point(this.X - (WH / 2.0 - CORNER_R), this.Y - (WH / 2.0 - CORNER_R)), CORNER_R),
                       DDCrashUtils.Circle(new D2Point(this.X + (WH / 2.0 - CORNER_R), this.Y - (WH / 2.0 - CORNER_R)), CORNER_R),
                       DDCrashUtils.Circle(new D2Point(this.X + (WH / 2.0 - CORNER_R), this.Y + (WH / 2.0 - CORNER_R)), CORNER_R),
                       DDCrashUtils.Circle(new D2Point(this.X - (WH / 2.0 - CORNER_R), this.Y + (WH / 2.0 - CORNER_R)), CORNER_R)
                       ));
        }