Beispiel #1
0
        public override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                DDUtils.Approach(ref this.A, this.Ended ? 0.0 : 1.0, 0.9);

                DDDraw.SetAlpha(this.A);
                DDDraw.DrawBegin(Ground.I.Picture.MessageWindow, this.X, this.Y);
                DDDraw.DrawZoom_X(this.LeftSide ? 1.0 : -1.0);
                DDDraw.DrawZoom_Y(-1.0);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                if (!this.Ended)
                {
                    DDPrint.SetBorder(new I3Color(40, 0, 0));
                    DDPrint.SetPrint(
                        (int)this.X - 200,
                        (int)this.Y - 0
                        );
                    DDPrint.PrintLine(this.Messages[0]);
                    DDPrint.PrintLine("");
                    DDPrint.PrintLine(this.Messages[1]);
                    DDPrint.Reset();
                }
                yield return(!this.Ended || 0.003 < this.A);
            }
        }
Beispiel #2
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.SetPrint((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);
            }
        }
Beispiel #3
0
        private void DrawStatus()
        {
            DDPrint.SetPrint(760, 30, 20);

            DDPrint.SetBorder(new I3Color(100, 0, 150));
            DDPrint.PrintLine("HiSCORE");
            DDPrint.PrintLine(string.Format("{0,20}", Ground.I.HiScore));

            DDPrint.SetBorder(new I3Color(110, 0, 140));
            DDPrint.PrintLine("  SCORE");
            DDPrint.PrintLine(string.Format("{0,20}", this.Score));
            DDPrint.PrintLine("");
            DDPrint.PrintLine("");

            DDPrint.SetBorder(new I3Color(120, 0, 130));
            DDPrint.PrintLine(string.Format(" PLAYER  {0}", string.Join("", Enumerable.Repeat("★", this.Zanki))));
            DDPrint.PrintLine("");

            DDPrint.SetBorder(new I3Color(130, 0, 120));
            DDPrint.PrintLine(string.Format("   BOMB  {0}", string.Join("", Enumerable.Repeat("@", this.ZanBomb))));
            DDPrint.PrintLine("");
            DDPrint.PrintLine("");
            DDPrint.PrintLine("");
            DDPrint.PrintLine("");

            DDPrint.SetBorder(new I3Color(150, 150, 100));
            DDPrint.PrintLine("  POWER");
            DDPrint.Reset();

            DrawStatus_Power();
        }
Beispiel #4
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);
            }
        }
Beispiel #5
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)));
            }
        }
Beispiel #6
0
            public override IEnumerable <bool> E_Task()
            {
                DDTaskList el = new DDTaskList();

                //el.Add(SCommon.Supplier(this.Effect_0001(1, 2, 3)));
                //el.Add(SCommon.Supplier(this.Effect_0001(4, 5, 6)));
                //el.Add(SCommon.Supplier(this.Effect_0001(7, 8, 9)));

                for (int frame = 0; ; frame++)
                {
                    DDPicture picture = Ground.I.Picture.Title;

                    DDDraw.DrawRect(
                        picture,
                        DDUtils.AdjustRectExterior(picture.GetSize().ToD2Size(), new D4Rect(0, 0, DDConsts.Screen_W, DDConsts.Screen_H))
                        );

                    DDCurtain.DrawCurtain(-0.8);

                    if (!this.TopMenuLeaved)
                    {
                        DDPrint.SetBorder(new I3Color(128, 0, 0));
                        DDPrint.SetPrint(75, 110, 0, 60);
                        DDPrint.Print("横スクロール アクション(仮)");
                        DDPrint.Reset();
                    }

                    el.ExecuteAllTask_Reverse();

                    yield return(true);
                }
            }
Beispiel #7
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);
            }
        }
Beispiel #8
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)
                {
                    GameCommon.SaveGame();
                    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.SetPrint((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);
            }
        }
Beispiel #9
0
            public override IEnumerable <bool> E_Task()
            {
                DDTaskList el = new DDTaskList();

                //el.Add(SCommon.Supplier(this.Effect_0001(1, 2, 3)));
                //el.Add(SCommon.Supplier(this.Effect_0001(4, 5, 6)));
                //el.Add(SCommon.Supplier(this.Effect_0001(7, 8, 9)));

                for (int frame = 0; ; frame++)
                {
                    DDDraw.SetBright(new I3Color(32, 0, 0));
                    DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, 0, DDConsts.Screen_W, DDConsts.Screen_H);
                    DDDraw.Reset();

                    if (!this.TopMenuLeaved)
                    {
                        DDPrint.SetBorder(new I3Color(128, 0, 0));
                        DDPrint.SetPrint(30, 30, 0, 60);
                        DDPrint.Print("ドレミーロックマン(仮)");
                        DDPrint.Reset();
                    }

                    el.ExecuteAllTask_Reverse();

                    yield return(true);
                }
            }
Beispiel #10
0
        protected override IEnumerable <bool> E_Draw()
        {
            // ---- 環境制御 ----

            Game.I.Walls.Add(new Wall_21001());
            Game.I.Walls.Add(new Wall_21002());

            // ----

            Func <bool> f_attack_01 = SCommon.Supplier(this.E_Attack_01());
            Func <bool> f_attack_02 = SCommon.Supplier(this.E_Attack_02());

            const int 画面分割_開始Frame = EnemyConsts_ルーミア.TRANS_FRAME + 180;

            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 (EnemyConsts_ルーミア.TRANS_FRAME < frame)
                {
                    if (!this.Mode_02)
                    {
                        if (frame < 画面分割_開始Frame)
                        {
                            double sec  = (画面分割_開始Frame - frame) / 60.0;
                            string sSec = sec.ToString("F2");

                            DDGround.EL.Add(() =>
                            {
                                DDPrint.SetPrint(
                                    GameConsts.FIELD_L + GameConsts.FIELD_W / 2 - 16,
                                    GameConsts.FIELD_T + GameConsts.FIELD_H / 2 - 8
                                    );
                                DDPrint.SetBorder(new I3Color(192, 0, 0));
                                DDPrint.SetColor(new I3Color(255, 255, 0));
                                DDPrint.Print(sSec);
                                DDPrint.Reset();

                                return(false);
                            });
                        }
                        else if (frame == 画面分割_開始Frame)
                        {
                            画面分割_Effect.Enter();
                            画面分割.Enabled = true;
                        }
                    }

                    f_attack_01();
                    f_attack_02();
                }

                EnemyCommon_ルーミア.PutCrash(this, frame);
                EnemyCommon_ルーミア.Draw(this.X, this.Y);

                yield return(true);
            }
        }
Beispiel #11
0
        public void Test01()
        {
            int index = 0;

            for (; ;)
            {
                if (DDInput.DIR_8.IsPound())
                {
                    index -= Consts.SCREEN_MAP_W;
                }
                if (DDInput.DIR_4.IsPound())
                {
                    index--;
                }
                if (DDInput.DIR_6.IsPound())
                {
                    index++;
                }
                if (DDInput.DIR_2.IsPound())
                {
                    index += Consts.SCREEN_MAP_W;
                }
                index += MapTileManager.GetCount();
                index %= MapTileManager.GetCount();

                // 描画 ...

                DDCurtain.DrawCurtain();

                {
                    int i = index;

                    for (int y = 0; y < Consts.SCREEN_MAP_H; y++)
                    {
                        for (int x = 0; x < Consts.SCREEN_MAP_W; x++)
                        {
                            DDDraw.DrawSimple(MapTileManager.GetTile(MapTileManager.GetNames()[i]).Picture, x * MapTile.WH, y * MapTile.WH);

                            i++;
                            i %= MapTileManager.GetCount();
                        }
                    }
                }

                DDPrint.SetPrint();
                DDPrint.SetBorder(new I3Color(0, 64, 0));

                for (int i = 0; i < 40; i++)
                {
                    DDPrint.PrintLine("[" + i.ToString("D2") + "] " + MapTileManager.GetNames()[(index + i) % MapTileManager.GetCount()]);
                }
                DDPrint.Reset();

                DDEngine.EachFrame();
            }
        }
Beispiel #12
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.SetPrint((int)draw_x, (int)draw_y);
            DDPrint.Print("扉");
            DDPrint.Reset();
        }
Beispiel #13
0
        public override void Draw(double x, double y)
        {
            DDDraw.DrawBegin(Ground.I.Picture.Dummy, x, y);
            DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
            DDDraw.DrawEnd();

            DDPrint.SetBorder(new I3Color(0, 0, 0));
            DDPrint.SetDebug((int)x, (int)y);
            DDPrint.Print("扉");
            DDPrint.Reset();
        }
Beispiel #14
0
        public static void DrawBossPosition(double x)
        {
            DDGround.EL.Add(() =>
            {
                DDPrint.SetPrint(GameConsts.FIELD_L + (int)x - 8 * 3, DDConsts.Screen_H - 16);
                DDPrint.SetBorder(new I3Color(255, 0, 0));
                DDPrint.Print("<BOSS>");
                DDPrint.Reset();

                return(false);
            });
        }
Beispiel #15
0
        private void Main4()
        {
            // *.INIT
            {
                // アプリ固有 >

                波紋効果.INIT();

                // < アプリ固有
            }

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

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

                    DDPrint.DebugPrint(string.Join(
                                           " ",
                                           波紋効果.Count,
                                           Game.I == null ? "-" : "" + Game.I.SnapshotCount,
                                           Game.I == null ? "-" : "" + Game.I.タイル接近_敵描画_Points.Count,
                                           "会ス" + (Ground.I.会話スキップ抑止 ? "抑" : "可"),

                                           Game.I == null ? "-" : "" + Game.I.行き先案内_Crashed_Start方面,
                                           Game.I == null ? "-" : "" + Game.I.行き先案内_Crashed_Goal方面,

                                           Game.I == null ? "-" : "" + Game.I.Player.X.ToString("F1"),
                                           Game.I == null ? "-" : "" + Game.I.Player.Y.ToString("F1"),

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

                                           DDEngine.FrameProcessingMillis,
                                           DDEngine.FrameProcessingMillis_Worst
                                           ));

                    DDPrint.Reset();
                };
            }

            if (ProcMain.DEBUG)
            {
                Main4_Debug();
            }
            else
            {
                Main4_Release();
            }
        }
Beispiel #16
0
        protected override IEnumerable <bool> E_Draw()
        {
            double r;

            switch (this.TamaKind)
            {
            case EnemyCommon.TAMA_KIND_e.NORMAL: r = 8.0; break;

            case EnemyCommon.TAMA_KIND_e.BIG: r = 12.0; break;

            case EnemyCommon.TAMA_KIND_e.LARGE: r = 30.0; break;

            // TODO: その他の敵弾についてもここへ追加..

            default:
                throw null;                         // never
            }
            double xAdd;
            double yAdd;

            DDUtils.MakeXYSpeed(this.X, this.Y, Game.I.Player.X, Game.I.Player.Y, this.Speed, out xAdd, out yAdd);
            DDUtils.Rotate(ref xAdd, ref yAdd, this.Angle);

            DDPicture picture = EnemyCommon.GetTamaPicture(this.TamaKind, this.TamaColor);

            for (; ;)
            {
                this.X += xAdd;
                this.Y += yAdd;

                DDDraw.DrawCenter(picture, this.X, this.Y);

                if (this.AbsorbableWeapon != -1)                 // ? 吸収可能
                {
                    DDDraw.SetAlpha(0.5);
                    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(0.5);
                    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();
                }
                this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), r);

                yield return(!EnemyCommon.IsEvacuated(this));
            }
        }
Beispiel #17
0
        public void Test01()
        {
            for (; ;)
            {
                DDPrint.SetBorder(new I3Color(0, 64, 192));
                DDPrint.SetPrint();
                DDPrint.Print("aaaいろは");
                DDPrint.Print("にほへ123");
                DDPrint.Print("日本語!");
                DDPrint.Print("9999");
                DDPrint.Reset();

                DDEngine.EachFrame();
            }
        }
Beispiel #18
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();
            }
        }
Beispiel #19
0
        private static void DrawMap()
        {
            int w = Game.I.Map.W;
            int h = Game.I.Map.H;

            int camL = DDGround.ICamera.X;
            int camT = DDGround.ICamera.Y;
            int camR = camL + DDConsts.Screen_W;
            int camB = camT + DDConsts.Screen_H;

            for (int x = 0; x < w; x++)
            {
                for (int y = 0; y < h; y++)
                {
                    int mapTileX = x * MapTile.WH + MapTile.WH / 2;
                    int mapTileY = y * MapTile.WH + MapTile.WH / 2;

                    if (DDUtils.IsOut(new D2Point(mapTileX, mapTileY), new D4Rect(camL, camT, camR, camB), 100.0) == false)                     // マージン要調整
                    {
                        MapCell cell = Game.I.Map.GetCell(x, y);

                        if (DisplayWallFlag && cell.Wall)
                        {
                            DDDraw.SetAlpha(0.3);
                            DDDraw.SetBright(1.0, 0.5, 0.0);
                            DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, mapTileX - camL, mapTileY - camT);
                            DDDraw.DrawSetSize(MapTile.WH, MapTile.WH);
                            DDDraw.DrawEnd();
                            DDDraw.Reset();
                        }
                        if (DisplayEnemyFlag && cell.EnemyLoader != null)
                        {
                            DDDraw.SetAlpha(0.3);
                            DDDraw.SetBright(0.0, 0.5, 1.0);
                            DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, mapTileX - camL, mapTileY - camT);
                            DDDraw.DrawSetSize(MapTile.WH, MapTile.WH);
                            DDDraw.DrawEnd();
                            DDDraw.Reset();

                            DDPrint.SetBorder(new I3Color(0, 0, 255));
                            DDPrint.SetPrint(mapTileX - camL - MapTile.WH / 2, mapTileY - camT - 8);
                            DDPrint.Print(cell.EnemyLoader.Name);
                            DDPrint.Reset();
                        }
                    }
                }
            }
        }
Beispiel #20
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);
            }
        }
Beispiel #21
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);
            }
        }
Beispiel #22
0
        private void DrawDungeon(double xSlideRate = 0.0)
        {
            DDCurtain.DrawCurtain();
            DDDraw.DrawCenter(DungeonScreen.DungScreen.ToPicture(), DDConsts.Screen_W / 2 + xSlideRate * 90.0, DDConsts.Screen_H / 2 - 150);
            DDDraw.DrawSimple(Ground.I.Picture.GameFrame, 0, 0);

            this.DistanceFromStart = DDUtils.GetDistance(
                this.Map.DungeonMap.StartPoint.X - this.Player.X,
                this.Map.DungeonMap.StartPoint.Y - this.Player.Y
                );

            DDUtils.Approach(ref this.DistanceFromStart_Delay, this.DistanceFromStart, 0.8);

            DDPrint.SetPrint(100, 410, 24);
            DDPrint.SetBorder(new I3Color(100, 50, 150));
            DDPrint.PrintLine("方角:" + "南西東北"[this.Player.Direction / 2 - 1]);
            DDPrint.PrintLine("スタート地点からの直線距離:" + this.DistanceFromStart_Delay.ToString("F3"));
            DDPrint.Reset();
        }
Beispiel #23
0
        public static void Drawノーミス()
        {
            if (Game.I.PlayerWasDead)
            {
                return;
            }

            const int DISPLAY_FRAME = 120;
            int       endFrame      = DDEngine.ProcFrame + DISPLAY_FRAME;

            DDGround.EL.Add(() =>
            {
                DDPrint.SetPrint(DDConsts.Screen_W - 120, DDConsts.Screen_H - 30);
                DDPrint.SetBorder(new I3Color(0, 0, 255));
                DDPrint.Print("ノーミス撃破");
                DDPrint.Reset();

                return(DDEngine.ProcFrame < endFrame);
            });
        }
Beispiel #24
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.SetPrint(
                        (int)this.X - DDGround.ICamera.X - 10,
                        (int)this.Y - DDGround.ICamera.Y - 10,
                        20
                        );
                    DDPrint.PrintLine("敵(仮)");
                    DDPrint.PrintLine("[無害]");
                    DDPrint.PrintLine("DIST=" + distance.ToString("F3"));
                    DDPrint.Reset();

                    // 当たり判定ナシ
                }
                yield return(true);
            }
        }
Beispiel #25
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();
                    }
                }
            }
        }
Beispiel #26
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));                // カメラから出たら消滅する。
            }
        }
Beispiel #27
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));                // カメラから出たら消滅する。
            }
        }
Beispiel #28
0
        public static IEnumerable <bool> Message(string message, I3Color color, I3Color borderColor)
        {
            Action a_draw_message = () =>
            {
                DDPrint.SetPrint(DDConsts.Screen_W / 2 - 4 * message.Length, DDConsts.Screen_H / 2 - 8);
                DDPrint.SetColor(color);
                DDPrint.SetBorder(borderColor);
                DDPrint.Print(message);
                DDPrint.Reset();
            };

            foreach (DDScene scene in DDSceneUtils.Create(20))
            {
                DDDraw.SetAlpha(0.5);
                DDDraw.SetBright(0, 0, 0);
                DDDraw.DrawRect_LTRB(
                    Ground.I.Picture.WhiteBox,
                    0,
                    DDConsts.Screen_H / 2 - (10 + 40 * scene.Rate),
                    DDConsts.Screen_W,
                    DDConsts.Screen_H / 2 + (10 + 40 * scene.Rate)
                    );
                DDDraw.Reset();

                a_draw_message();

                yield return(true);
            }
            foreach (DDScene scene in DDSceneUtils.Create(180))
            {
                DDDraw.SetAlpha(0.5);
                DDDraw.SetBright(0, 0, 0);
                DDDraw.DrawRect_LTRB(
                    Ground.I.Picture.WhiteBox,
                    0,
                    DDConsts.Screen_H / 2 - 50,
                    DDConsts.Screen_W,
                    DDConsts.Screen_H / 2 + 50
                    );
                DDDraw.Reset();

                a_draw_message();

                yield return(true);
            }
            foreach (DDScene scene in DDSceneUtils.Create(20))
            {
                DDDraw.SetAlpha(0.5);
                DDDraw.SetBright(0, 0, 0);
                DDDraw.DrawRect_LTRB(
                    Ground.I.Picture.WhiteBox,
                    0,
                    DDConsts.Screen_H / 2 - (10 + 40 * (1.0 - scene.Rate)),
                    DDConsts.Screen_W,
                    DDConsts.Screen_H / 2 + (10 + 40 * (1.0 - scene.Rate))
                    );
                DDDraw.Reset();

                a_draw_message();

                yield return(true);
            }
        }
Beispiel #29
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)) // 左シフト・コントロール押下 -> 塗り潰し_L / 塗り潰し_R
                {
                    if (DDMouse.L.GetInput() == -1)                                                              // クリックを検出
                    {
                        this.Map.Save();                                                                         // 失敗を想定して、セーブしておく

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

                            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 (DDMouse.R.GetInput() == -1)         // クリックを検出
                    {
                        this.Map.Save();                         // 失敗を想定して、セーブしておく

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

                            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:
                            // none
                            break;

                        default:
                            throw null;                                     // never
                        }
                    }
                }
                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))                 // 左コントロール押下 -> スポイト_L / スポイト_R
                {
                    if (1 <= DDMouse.L.GetInput())
                    {
                        switch (LevelEditor.Dlg.GetMode())
                        {
                        case LevelEditor.Mode_e.TILE:
                            LevelEditor.Dlg.SetTile_L(cell.TileName);
                            break;

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

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

                        case LevelEditor.Mode_e.ENEMY:
                            // none
                            break;

                        default:
                            throw null;                                     // never
                        }
                    }
                }
                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                 // シフト系押下無し -> セット_L / セット_R (敵はクリア)
                {
                    if (1 <= DDMouse.L.GetInput())
                    {
                        switch (LevelEditor.Dlg.GetMode())
                        {
                        case LevelEditor.Mode_e.TILE:
                        {
                            string tileName = LevelEditor.Dlg.GetTile_L();

                            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:
                        {
                            string tileName = LevelEditor.Dlg.GetTile_R();

                            cell.TileName = tileName;
                            cell.Tile     = TileCatalog.Create(tileName);
                        }
                        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.SetPrint(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.SetPrint(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();             // ★★★ マップをセーブする ★★★
        }
Beispiel #30
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.SetPrint();
                    DDPrint.SetBorder(new I3Color(0, 0, 0));

                    DDPrint.Print(string.Join(" ",
                                              DDEngine.FrameProcessingMillis,
                                              DDEngine.FrameProcessingMillis_Worst,
                                              DDMouse.X,
                                              DDMouse.Y

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

                    DDPrint.Reset();
                };
            }

            if (ProcMain.DEBUG)
            {
                Main4_Debug();
            }
            else if (ProcMain.ArgsReader.HasArgs())             // シナリオファイルを指定して実行
            {
                string name            = ProcMain.ArgsReader.NextArg();
                string scenarioRootDir = Path.Combine(ProcMain.SelfDir, DDConsts.ResourceDir_InternalRelease, Scenario.SCENARIO_FILE_PREFIX);

                scenarioRootDir = SCommon.MakeFullPath(scenarioRootDir);

                name = SCommon.MakeFullPath(name);
                name = SCommon.ChangeRoot(name, scenarioRootDir);
                name = Path.Combine(Path.GetDirectoryName(name), Path.GetFileNameWithoutExtension(name));                 // remove extention

                using (new Game())
                {
                    Game.I.Status.Scenario = new Scenario(name);
                    Game.I.Perform();
                }
            }
            else
            {
                Main4_Release();
            }
        }