コード例 #1
0
        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)));
            }
        }
コード例 #2
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 30.0)                 // ? 十分に接近 -> 取得する。
                {
                    Game.I.Status.InventoryFlags[GameStatus.Inventory_e.取得済み_跳ねる陰陽玉] = true;
                    break;
                }

                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 / 30.0);
                    DDDraw.DrawEnd();

                    DDPrint.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y);
                    DDPrint.SetBorder(new I3Color(0, 0, 0));
                    DDPrint.PrintLine("跳ねる陰陽玉");
                    DDPrint.Reset();

                    // 当たり判定無し
                }
                yield return(true);
            }
        }
コード例 #3
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 30.0)
                {
                    foreach (bool v in this.E_ハック実行())
                    {
                        yield return(v);
                    }

                    break;
                }

                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 / 100.0);
                    DDDraw.DrawEnd();

                    DDPrint.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y);
                    DDPrint.SetBorder(new I3Color(0, 0, 0));
                    DDPrint.PrintLine("ハック0001");
                    DDPrint.Reset();

                    // 当たり判定無し
                }
                yield return(true);
            }
        }
コード例 #4
0
        protected override IEnumerable <bool> E_Draw()
        {
            double xSpeed = 1.0;

            for (; ;)
            {
                xSpeed -= 0.1;
                this.X += xSpeed;

                if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 60.0)
                {
                    this.プレイヤーがアイテムを取得した();
                    break;
                }

                DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X, this.Y);
                DDDraw.DrawRotate(DDEngine.ProcFrame / 10.0);
                DDDraw.DrawEnd();

                DDPrint.SetDebug((int)this.X, (int)this.Y);
                DDPrint.SetBorder(new I3Color(0, 0, 0));
                DDPrint.PrintLine("アイテム");
                DDPrint.PrintLine("効用:" + 効用_e_Names[(int)this.効用]);
                DDPrint.Reset();

                // 当たり判定無し

                yield return(true);
            }
        }
コード例 #5
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                if (DDUtils.GetDistance(new D2Point(Game.I.Player.X, Game.I.Player.Y), new D2Point(this.X, this.Y)) < 30.0)
                {
                    this.プレイヤーがアイテムを取得した();
                    break;
                }

                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.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y);
                    DDPrint.SetBorder(new I3Color(0, 0, 0));
                    DDPrint.PrintLine("アイテム");
                    DDPrint.PrintLine("効用:" + 効用_e_Names[(int)this.効用]);
                    DDPrint.Reset();

                    // 当たり判定無し
                }
                yield return(true);
            }
        }
コード例 #6
0
        public override void Draw(double draw_x, double draw_y, int map_x, int map_y)
        {
            DDDraw.DrawBegin(Ground.I.Picture.Dummy, draw_x, draw_y);
            DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
            DDDraw.DrawEnd();

            DDPrint.SetBorder(new I3Color(0, 0, 0));
            DDPrint.SetDebug((int)draw_x, (int)draw_y);
            DDPrint.Print("扉");
            DDPrint.Reset();
        }
コード例 #7
0
        private void Main4()
        {
            // *.INIT
            {
                // アプリ固有 >

                //RippleEffect.INIT();
                //画面分割.INIT();
                //画面分割_Effect.INIT();

                // < アプリ固有
            }

            //DDTouch.Touch(); // moved -> Logo

            if (DDConfig.LOG_ENABLED)
            {
                DDEngine.DispDebug = () =>
                {
                    DDPrint.SetDebug();
                    DDPrint.SetBorder(new I3Color(0, 0, 0));

                    DDPrint.Print(string.Join(
                                      " ",
                                      //Game.I == null ? "-" : "" + Game.I.Player.HP,
                                      Game.I == null ? "-" : "" + Game.I.Player.JumpCount,
                                      Game.I == null ? "-" : "" + Game.I.Player.ShotChargePCT.ToString("D3"),
                                      Game.I == null ? "-" : "" + Game.I.Status.Equipment,

                                      // デバッグ表示する情報をここへ追加..

                                      DDEngine.FrameProcessingMillis,
                                      DDEngine.FrameProcessingMillis_Worst
                                      ));

                    DDPrint.Reset();
                };
            }

            if (ProcMain.DEBUG)
            {
                Main4_Debug();
            }
            else
            {
                Main4_Release();
            }
        }
コード例 #8
0
        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);
            }
        }
コード例 #9
0
        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.SetDebug(
                        (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);
            }
        }
コード例 #10
0
        public static void DrawEnemy()
        {
            int cam_l = DDGround.ICamera.X;
            int cam_t = DDGround.ICamera.Y;
            int cam_r = cam_l + DDConsts.Screen_W;
            int cam_b = cam_t + DDConsts.Screen_H;

            I2Point lt = GameCommon.ToTablePoint(cam_l, cam_t);
            I2Point rb = GameCommon.ToTablePoint(cam_r, cam_b);

            for (int x = lt.X; x <= rb.X; x++)
            {
                for (int y = lt.Y; y <= rb.Y; y++)
                {
                    MapCell cell = Game.I.Map.GetCell(x, y);

                    if (cell.EnemyName != GameConsts.ENEMY_NONE)
                    {
                        int tileL = x * GameConsts.TILE_W;
                        int tileT = y * GameConsts.TILE_H;

                        DDDraw.SetAlpha(0.3);
                        DDDraw.SetBright(new I3Color(0, 128, 255));
                        DDDraw.DrawRect(
                            Ground.I.Picture.WhiteBox,
                            tileL - cam_l,
                            tileT - cam_t,
                            GameConsts.TILE_W,
                            GameConsts.TILE_H
                            );
                        DDDraw.Reset();

                        DDPrint.SetBorder(new I3Color(0, 128, 255));
                        DDPrint.SetDebug(tileL - cam_l, tileT - cam_t);
                        DDPrint.Print(cell.EnemyName);
                        DDPrint.Reset();
                    }
                }
            }
        }
コード例 #11
0
        protected override IEnumerable <bool> E_Draw()
        {
            double SCALE = LevelToScale(this.Level);
            double R     = SCommon.ToInt(24.0 * SCALE);

            double yAdd = 0.0;

            // 初期位置調整
            {
                this.X += (36.0 + R * (1 + 2 * this.Order)) * (this.FacingLeft ? -1 : 1);
                //this.Y += 0.0;
            }

            for (; ;)
            {
                yAdd -= (0.2 + 0.05 * this.Order) * SCALE;

                this.X += (4.0 + 0.5 * this.Order) * SCALE * (this.FacingLeft ? -1 : 1);
                this.Y += yAdd;

                DDDraw.SetBright(new I3Color(0, 192, 192));
                DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawSetSize(R * 2, R * 2);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDPrint.SetDebug(
                    (int)this.X - DDGround.ICamera.X - 12,
                    (int)this.Y - DDGround.ICamera.Y - 8
                    );
                DDPrint.SetBorder(new I3Color(0, 0, 0));
                DDPrint.Print("AS" + this.Level);
                DDPrint.Reset();

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

                yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), R));                // カメラから出たら消滅する。
            }
        }
コード例 #12
0
        protected override IEnumerable <bool> E_Draw()
        {
            double SCALE = LevelToScale(this.Level);
            double R     = SCommon.ToInt(24.0 * SCALE);

            int yAddDir = 0;

            for (; ;)
            {
                if (yAddDir == 0)
                {
                    this.X += 10.0 * (this.FacingLeft ? -1 : 1);
                    yAddDir = this.索敵(R);
                }
                else
                {
                    this.Y += 10.0 * yAddDir;
                }

                DDDraw.SetBright(new I3Color(0, 192, 255));
                DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawSetSize(R * 2, R * 2);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDPrint.SetDebug(
                    (int)this.X - DDGround.ICamera.X - 12,
                    (int)this.Y - DDGround.ICamera.Y - 8
                    );
                DDPrint.SetBorder(new I3Color(0, 0, 0));
                DDPrint.Print("MA" + this.Level);
                DDPrint.Reset();

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

                yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), R));                // カメラから出たら消滅する。
            }
        }
コード例 #13
0
        private int HitBackFrame = 0;         // 0 == 無効, 1~ ヒットバック中

        protected override IEnumerable <bool> E_Draw()
        {
            for (int frame = 0; ; frame++)
            {
                double SPEED = 2.0;
                double xBuru = 0.0;
                double yBuru = 0.0;

                if (1 <= this.HitBackFrame)
                {
                    int frm = this.HitBackFrame - 1;

                    if (HIT_BACK_FRAME_MAX < frm)
                    {
                        this.HitBackFrame = 0;
                        goto endHitBack;
                    }
                    this.HitBackFrame++;

                    // ----

                    double rate = (double)frm / HIT_BACK_FRAME_MAX;

                    SPEED = 0.0;
                    xBuru = (1.0 - rate) * 30.0 * DDUtils.Random.Real();
                    yBuru = (1.0 - rate) * 30.0 * DDUtils.Random.Real();
                }
endHitBack:

                switch (frame / 60 % 4)
                {
                case 0: this.X += SPEED; break;

                case 1: this.Y += SPEED; break;

                case 2: this.X -= SPEED; break;

                case 3: this.Y -= SPEED; break;

                default:
                    throw null;                             // never
                }

                if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 100.0))
                {
                    if (1 <= this.HitBackFrame)
                    {
                        DDDraw.SetBright(1.0, 0.8, 1.0);
                    }
                    else
                    {
                        DDDraw.SetBright(1.0, 0.5, 0.0);
                    }

                    DDDraw.DrawBegin(
                        Ground.I.Picture.WhiteBox,
                        this.X - DDGround.ICamera.X + xBuru,
                        this.Y - DDGround.ICamera.Y + yBuru
                        );
                    DDDraw.DrawSetSize(100.0, 100.0);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    DDPrint.SetBorder(new I3Color(128, 64, 0));
                    DDPrint.SetDebug(
                        (int)this.X - DDGround.ICamera.X - 46,
                        (int)this.Y - DDGround.ICamera.Y - 46,
                        20
                        );
                    DDPrint.PrintLine("敵(仮)");
                    DDPrint.PrintLine("HP:" + this.HP);
                    DDPrint.Reset();

                    this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(100.0, 100.0));
                }
                yield return(true);
            }
        }
コード例 #14
0
        protected override IEnumerable <bool> E_Draw()
        {
            const double CHARA_R = 20.0;

            double ySpeed = 0.0;

            for (; ;)
            {
                if (Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(this.X - CHARA_R, this.Y))).Tile.IsWall())                 // ? 左側面接触
                {
                    this.FacingLeft = false;
                }
                if (Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(this.X + CHARA_R, this.Y))).Tile.IsWall())                 // ? 右側面接触
                {
                    this.FacingLeft = true;
                }

                if (this.端から落ちない)
                {
                    const double 判定_X = 10.0;
                    const double 判定_Y = CHARA_R + 1.0;

                    if (!Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(this.X - 判定_X, this.Y + 判定_Y))).Tile.IsWall())                     // ? 左下足場無し -> 引き返す。
                    {
                        this.FacingLeft = false;
                    }
                    if (!Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(this.X + 判定_X, this.Y + 判定_Y))).Tile.IsWall())                     // ? 右下足場なし -> 引き返す。
                    {
                        this.FacingLeft = true;
                    }
                }

                const double X_SPEED     = 1.0;
                const double GRAVITY     = 0.5;
                const double Y_SPEED_MAX = 10.0;

                this.X += X_SPEED * (this.FacingLeft ? -1 : 1);
                this.Y += ySpeed;

                ySpeed += GRAVITY;
                ySpeed  = Math.Min(ySpeed, Y_SPEED_MAX);

                if (GameCommon.壁処理(ref this.X, ref this.Y, new D2Point[] { new D2Point(0.0, CHARA_R) }))
                {
                    ySpeed = 0.0;
                }

                if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), CHARA_R * 1.2))
                {
                    // 暫定_描画
                    {
                        DDDraw.SetBright(new I3Color(64, 64, 255));
                        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 + "_" + (this.端から落ちない ? 1 : 0) + "]");
                        DDPrint.Reset();
                    }

                    this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), CHARA_R);
                }
                yield return(true);
            }
        }
コード例 #15
0
        public void Perform()
        {
            if (DDConfig.LOG_ENABLED)             // 開発・デバッグ_モードであることを表示
            {
#if true
                DDGround.EL.Keep(300, () =>
                {
                    DDPrint.SetDebug(30, DDConsts.Screen_H - 32);
                    DDPrint.Print("これはクローズドテスト版です。仮リソース・未実装・不完全な機能を含みます。(このメッセージは数秒で消えます)");
                });
#else // old nearly same
                int endFrame = DDEngine.ProcFrame + 300;

                DDGround.EL.Add(() =>
                {
                    int remFrame = endFrame - DDEngine.ProcFrame;

                    DDPrint.SetDebug(70, DDConsts.Screen_H - 32);
                    DDPrint.Print("これはクローズドテスト版です。仮リソース・未実装・不完全な機能を含みます。(あと " + (remFrame / 60.0).ToString("F1") + " 秒で消えます)");

                    return(0 < remFrame);
                });
#endif
            }

            foreach (DDScene scene in DDSceneUtils.Create(60))             // LiteStatusDlg を閉じるまでの遅延の分(30フレーム)延長
            //foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                DDCurtain.DrawCurtain();
                DDEngine.EachFrame();
            }

            double z1 = 0.3;
            double z2 = 2.0;
            double z3 = 3.7;

            foreach (DDScene scene in DDSceneUtils.Create(60))
            {
                DDCurtain.DrawCurtain();

                DDDraw.SetAlpha(scene.Rate);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.7);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(0.8 + 0.5 * scene.Rate);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z2);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z3);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDUtils.Approach(ref z1, 1.0, 0.9);
                DDUtils.Approach(ref z2, 1.0, 0.98);
                DDUtils.Approach(ref z3, 1.0, 0.95);

                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(90))
            {
                DDCurtain.DrawCurtain();
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(60))
            {
                DDCurtain.DrawCurtain();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.0 - 0.3 * scene.Rate);
                DDDraw.DrawRotate(scene.Rate * -0.1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.0 + 0.8 * scene.Rate);
                DDDraw.DrawRotate(scene.Rate * 0.1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2 + scene.Rate * 100.0, DDConsts.Screen_H / 2);
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2 + scene.Rate * 50.0);
                DDDraw.Reset();

                DDEngine.EachFrame();
            }
        }
コード例 #16
0
        protected override IEnumerable <bool> E_Draw()
        {
            const double CHARA_R = 20.0;

            double ySpeed = 0.0;

            for (int frame = 0; ; frame++)
            {
                while (DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), CHARA_R))                 // 画面外に居るときは休止する。
                {
                    yield return(true);
                }

                const double GRAVITY     = 1.0;
                const double Y_SPEED_MAX = 10.0;

                this.Y += ySpeed;

                ySpeed += GRAVITY;
                ySpeed  = Math.Min(ySpeed, Y_SPEED_MAX);

                if (GameCommon.壁処理(ref this.X, ref this.Y, new D2Point[] { new D2Point(0.0, CHARA_R) }))
                {
                    ySpeed = 0.0;
                }

                const int FRAME_DIV = 200;

                int frameDiv = frame / FRAME_DIV;
                int frameMod = frame % FRAME_DIV;

                this.防御中 = frameDiv % 2 == 0;

                if (!this.防御中)
                {
                    if (
                        frameMod == 20 ||
                        frameMod == 60 ||
                        frameMod == 100
                        )
                    {
#if true
                        int xSign = Game.I.Player.X < this.X ? -1 : 1;

                        Game.I.Enemies.Add(new Enemy_弾(this.X, this.Y, 3.5 * xSign, -3.5));
                        Game.I.Enemies.Add(new Enemy_弾(this.X, this.Y, 5.0 * xSign, 0.0));
                        Game.I.Enemies.Add(new Enemy_弾(this.X, this.Y, 3.5 * xSign, 3.5));
#else
                        Game.I.Enemies.Add(Enemy_弾.Create自機狙い(this.X, this.Y, 5.0, -0.3));
                        Game.I.Enemies.Add(Enemy_弾.Create自機狙い(this.X, this.Y, 5.0));
                        Game.I.Enemies.Add(Enemy_弾.Create自機狙い(this.X, this.Y, 5.0, 0.3));
#endif
                    }
                }

                //if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), CHARA_R * 1.2)) // 画面外は休止
                {
                    // 暫定_描画
                    {
                        DDDraw.SetBright(this.防御中 ? new I3Color(64, 192, 64) : new I3Color(255, 128, 128));
                        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(string.Format("[メット◆ル_{0}_{1}]", this.HP, this.防御中 ? "防" : "攻"));
                        DDPrint.Reset();
                    }

                    this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), CHARA_R);
                }
                yield return(true);
            }
        }
コード例 #17
0
        public void Test01()
        {
            DDPicture[][] motions = new DDPicture[][]
            {
                Ground.I.Picture2.Tewi_立ち,
                Ground.I.Picture2.Tewi_振り向き,
                Ground.I.Picture2.Tewi_しゃがみ,
                Ground.I.Picture2.Tewi_しゃがみ解除,
                Ground.I.Picture2.Tewi_しゃがみ振り向き,
                //Ground.I.Picture2.Tewi_ジャンプ_開始,
                Ground.I.Picture2.Tewi_ジャンプ_上昇,
                Ground.I.Picture2.Tewi_ジャンプ_下降,
                //Ground.I.Picture2.Tewi_ジャンプ_着地,
                //Ground.I.Picture2.Tewi_後ろジャンプ,
                Ground.I.Picture2.Tewi_歩く,
                Ground.I.Picture2.Tewi_走る,
                Ground.I.Picture2.Tewi_小ダメージ,
                Ground.I.Picture2.Tewi_大ダメージ,
                Ground.I.Picture2.Tewi_しゃがみ小ダメージ,
                Ground.I.Picture2.Tewi_しゃがみ大ダメージ,
                Ground.I.Picture2.Tewi_飛翔_開始,
                Ground.I.Picture2.Tewi_飛翔_前進,
                Ground.I.Picture2.Tewi_弱攻撃,
                Ground.I.Picture2.Tewi_中攻撃,
                Ground.I.Picture2.Tewi_強攻撃,
                Ground.I.Picture2.Tewi_しゃがみ弱攻撃,
                Ground.I.Picture2.Tewi_しゃがみ中攻撃,
                Ground.I.Picture2.Tewi_しゃがみ強攻撃,
                Ground.I.Picture2.Tewi_ジャンプ弱攻撃,
                Ground.I.Picture2.Tewi_ジャンプ中攻撃,
                Ground.I.Picture2.Tewi_ジャンプ強攻撃,
                //Ground.I.Picture2.Tewi_ジャンプ強攻撃_開始,
                //Ground.I.Picture2.Tewi_ジャンプ強攻撃_回転,
                //Ground.I.Picture2.Tewi_ジャンプ強攻撃_終了,

                Ground.I.Picture2.Cirno_立ち,
                Ground.I.Picture2.Cirno_しゃがみ,
                Ground.I.Picture2.Cirno_しゃがみ解除,
                //Ground.I.Picture2.Cirno_ジャンプ_開始,
                Ground.I.Picture2.Cirno_ジャンプ_上昇,
                Ground.I.Picture2.Cirno_ジャンプ_下降,
                //Ground.I.Picture2.Cirno_ジャンプ_着地,
                //Ground.I.Picture2.Cirno_後ろジャンプ,
                Ground.I.Picture2.Cirno_歩く,
                Ground.I.Picture2.Cirno_走る,
                Ground.I.Picture2.Cirno_ダメージ,
                Ground.I.Picture2.Cirno_しゃがみダメージ,
                Ground.I.Picture2.Cirno_飛翔,
                Ground.I.Picture2.Cirno_攻撃,
                Ground.I.Picture2.Cirno_しゃがみ攻撃,
                Ground.I.Picture2.Cirno_ジャンプ攻撃,
            };

            DDEngine.FreezeInput();

            int motionIndex = 0;
            int komaIndex   = 0;

            for (int frame = 0; ; frame++)
            {
                if (DDInput.DIR_8.IsPound())
                {
                    motionIndex--;
                }

                if (DDInput.DIR_2.IsPound())
                {
                    motionIndex++;
                }

                if (DDInput.DIR_4.IsPound())
                {
                    komaIndex--;
                }

                if (DDInput.DIR_6.IsPound())
                {
                    komaIndex++;
                }

                motionIndex += motions.Length;
                motionIndex %= motions.Length;

                DDPicture[] motion = motions[motionIndex];

                komaIndex = SCommon.ToRange(komaIndex, -1, motion.Length - 1);

                int koma = komaIndex;

                if (koma == -1)
                {
                    koma = (frame / 5) % motion.Length;
                }

                DDCurtain.DrawCurtain(1.0);
                DDCurtain.DrawCurtain(-0.5);

                DDPrint.SetDebug(0, 16);
                DDPrint.Print(string.Join(", ", motionIndex, komaIndex, koma));

                DDDraw.DrawCenter(motion[koma], DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);

                DDDraw.DrawBegin(Ground.I.Picture.Dummy, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(0.1);
                DDDraw.DrawEnd();

                DDEngine.EachFrame();
            }
        }
コード例 #18
0
        public void Perform()
        {
            if (DDConfig.LOG_ENABLED)             // 開発・デバッグ_モードであることを表示
            {
                DDGround.EL.Keep(300, () =>
                {
                    DDPrint.SetDebug(30, DDConsts.Screen_H - 32);
                    DDPrint.Print("これはクローズドテスト版です。仮リソース・未実装・不完全な機能を含みます。(このメッセージは数秒で消えます)");
                });
            }

            foreach (DDScene scene in DDSceneUtils.Create(60))             // LiteStatusDlg を閉じるまでの遅延の分(30フレーム)延長
            //foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                DDCurtain.DrawCurtain();
                DDEngine.EachFrame();
            }

            double z1 = 0.3;
            double z2 = 2.0;
            double z3 = 3.7;

            foreach (DDScene scene in DDSceneUtils.Create(60))
            {
                DDCurtain.DrawCurtain();

                DDDraw.SetAlpha(scene.Rate);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.7);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(0.8 + 0.5 * scene.Rate);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z2);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z3);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDUtils.Approach(ref z1, 1.0, 0.9);
                DDUtils.Approach(ref z2, 1.0, 0.98);
                DDUtils.Approach(ref z3, 1.0, 0.95);

                DDEngine.EachFrame();
            }

            {
                long endLoopTime = long.MaxValue;

                for (int frame = 0; ; frame++)
                {
                    if (endLoopTime < DDEngine.FrameStartTime)
                    {
                        break;
                    }

                    if (frame == 1)
                    {
                        endLoopTime = DDEngine.FrameStartTime + 1500;
                        DDTouch.Touch();
                    }
                    DDCurtain.DrawCurtain();
                    DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                    DDEngine.EachFrame();
                }
            }

            foreach (DDScene scene in DDSceneUtils.Create(60))
            {
                DDCurtain.DrawCurtain();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.0 - 0.3 * scene.Rate);
                DDDraw.DrawRotate(scene.Rate * -0.1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.0 + 0.8 * scene.Rate);
                DDDraw.DrawRotate(scene.Rate * 0.1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2 + scene.Rate * 100.0, DDConsts.Screen_H / 2);
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2 + scene.Rate * 50.0);
                DDDraw.Reset();

                DDEngine.EachFrame();
            }
        }
コード例 #19
0
        private void Edit()
        {
            this.Map.Load();             // ゲーム中にマップを書き換える場合があるので、再ロードする。

            DDEngine.FreezeInput();
            DDUtils.SetMouseDispMode(true);
            LevelEditor.ShowDialog();

            int lastMouseX = DDMouse.X;
            int lastMouseY = DDMouse.Y;

            for (; ;)
            {
                if (LevelEditor.Dlg.XPressed)
                {
                    break;
                }

                // 廃止
                //if (DDKey.GetInput(DX.KEY_INPUT_E) == 1)
                //    break;

                I2Point cellPos = GameCommon.ToTablePoint(
                    DDGround.Camera.X + DDMouse.X,
                    DDGround.Camera.Y + DDMouse.Y
                    );

                MapCell cell = Game.I.Map.GetCell(cellPos);

                if (cell.IsDefault)
                {
                    // noop
                }
                else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LSHIFT) && 1 <= DDKey.GetInput(DX.KEY_INPUT_LCONTROL)) // 左シフト・コントロール押下 -> 塗り潰し / none
                {
                    if (DDMouse.L.GetInput() == -1)                                                              // クリックを検出
                    {
                        this.Map.Save();                                                                         // 失敗を想定して、セーブしておく

                        switch (LevelEditor.Dlg.GetMode())
                        {
                        case LevelEditor.Mode_e.TILE:
                        {
                            string tileName = LevelEditor.Dlg.GetTile();

                            if (tileName != cell.TileName)
                            {
                                string targetTileName = cell.TileName;                                                 // cell.TileName は this.EditFill で変更される。

                                this.EditFill(
                                    cellPos,
                                    v => v.TileName == targetTileName,
                                    v =>
                                    {
                                        v.TileName = tileName;
                                        v.Tile     = TileCatalog.Create(tileName);
                                    }
                                    );
                            }
                        }
                        break;

                        case LevelEditor.Mode_e.ENEMY:
                        {
                            string enemyName = LevelEditor.Dlg.GetEnemy();

                            if (enemyName != cell.EnemyName)
                            {
                                string targetEnemyName = cell.EnemyName;                                                 // cell.EnemyName は this.EditFill で変更される。

                                this.EditFill(
                                    cellPos,
                                    v => v.EnemyName == targetEnemyName,
                                    v => v.EnemyName = enemyName
                                    );
                            }
                        }
                        break;

                        default:
                            throw null;                                     // never
                        }
                    }
                    else if (1 <= DDMouse.R.GetInput())
                    {
                        // none
                    }
                }
                else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LSHIFT))                 // 左シフト押下 -> 移動 / none
                {
                    if (1 <= DDMouse.L.GetInput())
                    {
                        DDGround.Camera.X -= DDMouse.X - lastMouseX;
                        DDGround.Camera.Y -= DDMouse.Y - lastMouseY;

                        DDUtils.ToRange(ref DDGround.Camera.X, 0.0, this.Map.W * GameConsts.TILE_W - DDConsts.Screen_W);
                        DDUtils.ToRange(ref DDGround.Camera.Y, 0.0, this.Map.H * GameConsts.TILE_H - DDConsts.Screen_H);

                        DDGround.ICamera.X = SCommon.ToInt(DDGround.Camera.X);
                        DDGround.ICamera.Y = SCommon.ToInt(DDGround.Camera.Y);
                    }
                    else if (1 <= DDMouse.R.GetInput())
                    {
                        // none
                    }
                }
                else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LCONTROL))                 // 左コントロール押下 -> スポイト / none
                {
                    if (1 <= DDMouse.L.GetInput())
                    {
                        switch (LevelEditor.Dlg.GetMode())
                        {
                        case LevelEditor.Mode_e.TILE:
                            LevelEditor.Dlg.SetTile(cell.TileName);
                            break;

                        case LevelEditor.Mode_e.ENEMY:
                            LevelEditor.Dlg.SetEnemy(cell.EnemyName);
                            break;

                        default:
                            throw null;                                     // never
                        }
                    }
                    else if (1 <= DDMouse.R.GetInput())
                    {
                        // none
                    }
                }
                else if (1 <= DDKey.GetInput(DX.KEY_INPUT_LALT))        // 左 ALT 押下 -> 自機ワープ / none
                {
                    if (DDMouse.L.GetInput() == -1)                     // クリックを検出
                    {
                        this.Player.X = cellPos.X * GameConsts.TILE_W + GameConsts.TILE_W / 2;
                        this.Player.Y = cellPos.Y * GameConsts.TILE_H + GameConsts.TILE_H / 2;

                        DDGround.EL.Add(SCommon.Supplier(Effects.中爆発(this.Player.X, this.Player.Y)));                         // アクションが分かるように
                    }
                    else if (1 <= DDMouse.R.GetInput())
                    {
                        // none
                    }
                }
                else                 // シフト系押下無し -> セット / クリア
                {
                    if (1 <= DDMouse.L.GetInput())
                    {
                        switch (LevelEditor.Dlg.GetMode())
                        {
                        case LevelEditor.Mode_e.TILE:
                        {
                            string tileName = LevelEditor.Dlg.GetTile();

                            cell.TileName = tileName;
                            cell.Tile     = TileCatalog.Create(tileName);
                        }
                        break;

                        case LevelEditor.Mode_e.ENEMY:
                        {
                            string enemyName = LevelEditor.Dlg.GetEnemy();

                            cell.EnemyName = enemyName;
                        }
                        break;

                        default:
                            throw null;                                     // never
                        }
                    }
                    else if (1 <= DDMouse.R.GetInput())
                    {
                        switch (LevelEditor.Dlg.GetMode())
                        {
                        case LevelEditor.Mode_e.TILE:
                            cell.TileName = GameConsts.TILE_NONE;
                            cell.Tile     = new Tile_None();
                            break;

                        case LevelEditor.Mode_e.ENEMY:
                            cell.EnemyName = GameConsts.ENEMY_NONE;
                            break;

                        default:
                            throw null;                                     // never
                        }
                    }
                }

                if (DDKey.GetInput(DX.KEY_INPUT_S) == 1)                 // S キー --> Save
                {
                    this.Map.Save();

                    // 表示
                    {
                        int endFrame = DDEngine.ProcFrame + 60;

                        DDGround.EL.Add(() =>
                        {
                            DDPrint.SetDebug(0, 16);
                            DDPrint.SetBorder(new I3Color(0, 0, 0));
                            DDPrint.Print("セーブしました...");
                            DDPrint.Reset();

                            return(DDEngine.ProcFrame < endFrame);
                        });
                    }
                }
                if (DDKey.GetInput(DX.KEY_INPUT_L) == 1)                 // L キー --> Load
                {
                    this.Map.Load();

                    // 表示
                    {
                        int endFrame = DDEngine.ProcFrame + 60;

                        DDGround.EL.Add(() =>
                        {
                            DDPrint.SetDebug(0, 16);
                            DDPrint.SetBorder(new I3Color(0, 0, 0));
                            DDPrint.Print("ロードしました...");
                            DDPrint.Reset();

                            return(DDEngine.ProcFrame < endFrame);
                        });
                    }
                }

                DDCurtain.DrawCurtain();

                if (LevelEditor.Dlg.IsShowTile())
                {
                    this.DrawMap();
                }

                if (LevelEditor.Dlg.IsShowEnemy())
                {
                    LevelEditor.DrawEnemy();
                }

                lastMouseX = DDMouse.X;
                lastMouseY = DDMouse.Y;

                DDEngine.EachFrame();
            }
            DDEngine.FreezeInput();
            DDUtils.SetMouseDispMode(false);
            LevelEditor.CloseDialog();

            this.Map.Save();             // ★★★ マップをセーブする ★★★
        }
コード例 #20
0
        private IEnumerable <int> E_EachFrame2()
        {
            DDRandom rand     = new DDRandom(1);
            DDRandom rand_Sub = new DDRandom(101);

            Ground.I.Music.Stage_01.Play();
            Game.I.Walls.Add(new Wall_B0003());
            yield return(100);

            foreach (DDScene scene in DDSceneUtils.Create((2 * 60 + 35) * 60))
            {
                DDGround.EL.Add(() =>
                {
                    DDPrint.SetDebug(GameConsts.FIELD_W - 180, 0);
                    DDPrint.SetBorder(new I3Color(0, 0, 0));
                    DDPrint.Print(scene.Numer + " / " + scene.Denom + " = " + scene.Rate.ToString("F3"));
                    DDPrint.Reset();

                    return(false);
                });

                if (rand.Real() < scene.Rate * 0.1)
                {
                    if (rand.Real() < 0.1)
                    {
                        Enemy_BItem.効用_e 効用;

                        if (rand_Sub.Real() < 0.1)
                        {
                            効用 = Enemy_BItem.効用_e.ZANKI_UP;
                        }
                        else if (rand_Sub.Real() < 0.2)
                        {
                            効用 = Enemy_BItem.効用_e.BOMB_ADD;
                        }
                        else
                        {
                            効用 = Enemy_BItem.効用_e.POWER_UP_WEAPON;
                        }

                        Game.I.Enemies.Add(new Enemy_B0002(GameConsts.FIELD_W + 50, rand.Real() * GameConsts.FIELD_H).AddKilled(enemy =>
                        {
                            Game.I.Enemies.Add(new Enemy_BItem(enemy.X, enemy.Y, 効用));
                        }
                                                                                                                                ));
                    }
                    else if (rand.Real() < 0.3)
                    {
                        Game.I.Enemies.Add(new Enemy_B0002(GameConsts.FIELD_W + 50, rand.Real() * GameConsts.FIELD_H));
                    }
                    else
                    {
                        Game.I.Enemies.Add(new Enemy_B0001(GameConsts.FIELD_W + 50, rand.Real() * GameConsts.FIELD_H));
                    }
                }
                yield return(1);
            }

            Game.I.システム的な敵クリア();
            yield return(120);

            Ground.I.Music.Boss_01.Play();
            Game.I.Walls.Add(new Wall_B0004());
            yield return(120);

            {
                Enemy boss = new Enemy_Bボス0001();

                Game.I.Enemies.Add(boss);

                while (!boss.DeadFlag)
                {
                    DDGround.EL.Add(() =>
                    {
                        DDPrint.SetDebug(GameConsts.FIELD_W - 140, 0);
                        DDPrint.SetBorder(new I3Color(0, 0, 0));
                        DDPrint.Print("BOSS_HP = " + boss.HP);
                        DDPrint.Reset();

                        return(false);
                    });

                    yield return(1);
                }
            }

            yield return(120);

            DDMusicUtils.Fade();
            yield return(120);

            Game.I.Script = new Script_Bステージ0002(); // 次のステージ

            yield return(1);                        // Script を差し替えた場合、最後に 1 以上を返す。
        }
コード例 #21
0
        public void Test01()
        {
            DDPicture[][] motions = new DDPicture[][]
            {
                Ground.I.Picture2.ほむらシールド,
                Ground.I.Picture2.ほむらバズーカ,
                Ground.I.Picture2.ほむら死亡,
                Ground.I.Picture2.ほむら走り,
                Ground.I.Picture2.ほむら滞空攻撃,
                Ground.I.Picture2.ほむら被弾,
                Ground.I.Picture2.ほむら立ち,

                Ground.I.Picture2.さやか死亡,
                Ground.I.Picture2.さやか接地攻撃,
                Ground.I.Picture2.さやか走り,
                Ground.I.Picture2.さやか滞空攻撃,
                Ground.I.Picture2.さやか突き,
                Ground.I.Picture2.さやか被弾,
                Ground.I.Picture2.さやか立ち,
            };

            DDEngine.FreezeInput();

            int motionIndex = 0;
            int komaIndex   = 0;

            for (int frame = 0; ; frame++)
            {
                if (DDInput.DIR_8.IsPound())
                {
                    motionIndex--;
                }

                if (DDInput.DIR_2.IsPound())
                {
                    motionIndex++;
                }

                if (DDInput.DIR_4.IsPound())
                {
                    komaIndex--;
                }

                if (DDInput.DIR_6.IsPound())
                {
                    komaIndex++;
                }

                motionIndex += motions.Length;
                motionIndex %= motions.Length;

                DDPicture[] motion = motions[motionIndex];

                komaIndex = SCommon.ToRange(komaIndex, -1, motion.Length - 1);

                int koma = komaIndex;

                if (koma == -1)
                {
                    koma = (frame / 5) % motion.Length;
                }

                DDCurtain.DrawCurtain(1.0);
                DDCurtain.DrawCurtain(-0.5);

                DDPrint.SetDebug();
                DDPrint.Print(string.Join(", ", motionIndex, komaIndex, koma));

                DDDraw.DrawCenter(motion[koma], DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);

                DDDraw.DrawBegin(Ground.I.Picture.Dummy, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(0.1);
                DDDraw.DrawEnd();

                DDEngine.EachFrame();
            }
        }
コード例 #22
0
        private void Main4()
        {
            // *.INIT
            {
                // アプリ固有 >

                //RippleEffect.INIT();
                //画面分割.INIT();
                //画面分割_Effect.INIT();

                // < アプリ固有
            }

            #region Charge To DDTouch

            // DDCCResource 等のための Touch
            //DDTouch.Add(TitleMenu.TouchWallDrawerResources);

            // 個別に設定
            //DDTouch.Add(Ground.I.Picture.XXX);
            //DDTouch.Add(Ground.I.Music.XXX);
            //DDTouch.Add(Ground.I.SE.XXX);

            // 全部設定
            //DDTouch.AddAllPicture();
            //DDTouch.AddAllMusic();
            //DDTouch.AddAllSE();

            #endregion

            //DDTouch.Touch(); // moved -> Logo

            if (DDConfig.LOG_ENABLED)
            {
                DDEngine.DispDebug = () =>
                {
                    DDPrint.SetDebug();
                    DDPrint.SetBorder(new I3Color(0, 0, 0));

                    DDPrint.Print(string.Join(
                                      " ",
                                      Game.I == null ? "-" : "" + Game.I.Player.HP,

                                      // デバッグ表示する情報をここへ追加..

                                      DDEngine.FrameProcessingMillis,
                                      DDEngine.FrameProcessingMillis_Worst
                                      ));

                    DDPrint.Reset();
                };
            }

            if (ProcMain.DEBUG)
            {
                Main4_Debug();
            }
            else
            {
                Main4_Release();
            }
        }
コード例 #23
0
        public void Perform()
        {
            // 開発中_暫定
            {
                int endFrame = DDEngine.ProcFrame + 300;

                DDGround.EL.Add(() =>
                {
                    int sec = endFrame - DDEngine.ProcFrame;

                    DDPrint.SetDebug(180, DDConsts.Screen_H - 32);
                    DDPrint.Print("これはクローズドテスト版です。仮リソース・実装されていない機能を含みます。(あと " + (sec / 60.0).ToString("F1") + " 秒で消えます)");

                    return(0 < sec);
                });
            }

            foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                DDCurtain.DrawCurtain();
                DDEngine.EachFrame();
            }

            double z1 = 0.3;
            double z2 = 2.0;
            double z3 = 3.7;

            foreach (DDScene scene in DDSceneUtils.Create(60))
            {
                DDCurtain.DrawCurtain();

                DDDraw.SetAlpha(scene.Rate);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.7);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(0.8 + 0.5 * scene.Rate);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z2);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(z3);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDUtils.Approach(ref z1, 1.0, 0.9);
                DDUtils.Approach(ref z2, 1.0, 0.98);
                DDUtils.Approach(ref z3, 1.0, 0.95);

                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(90))
            {
                DDCurtain.DrawCurtain();
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDEngine.EachFrame();
            }
            foreach (DDScene scene in DDSceneUtils.Create(60))
            {
                DDCurtain.DrawCurtain();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.0 - 0.3 * scene.Rate);
                DDDraw.DrawRotate(scene.Rate * -0.1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.0 + 0.8 * scene.Rate);
                DDDraw.DrawRotate(scene.Rate * 0.1);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2 + scene.Rate * 100.0, DDConsts.Screen_H / 2);
                DDDraw.Reset();

                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.3);
                DDDraw.DrawCenter(Ground.I.Picture.Copyright, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2 + scene.Rate * 50.0);
                DDDraw.Reset();

                DDEngine.EachFrame();
            }
        }