Example #1
0
        public void Test01()
        {
            int rot = 0;

            for (; ;)
            {
                DDCurtain.DrawCurtain();

                DDMouse.UpdatePos();

                rot += DDMouse.Rot;

                DDPrint.SetPrint();
                DDPrint.Print(string.Join(
                                  ", "
                                  , DDMouse.L.GetInput()
                                  , DDMouse.R.GetInput()
                                  , DDMouse.M.GetInput()
                                  , DDMouse.L.IsPound() ? 1 : 0
                                  , DDMouse.R.IsPound() ? 1 : 0
                                  , DDMouse.M.IsPound() ? 1 : 0
                                  , DDMouse.X
                                  , DDMouse.Y
                                  //, DDMouse.Rot
                                  , rot
                                  ));

                DDEngine.EachFrame();
            }
        }
Example #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)
                {
                    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);
            }
        }
Example #3
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.SetPrint((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)));
            }
        }
Example #4
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);
                }
            }
Example #5
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();
        }
Example #6
0
        private static void DrawMenu()
        {
            DDDraw.SetAlpha(0.5);
            DDDraw.SetBright(0.0, 0.3, 0.6);
            DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, MenuRect.L, MenuRect.T, MenuRect.W, MenuRect.H);
            DDDraw.Reset();

            DDPrint.SetPrint();
            DDPrint.PrintLine("INPUT WALL: " + InputWallFlag);
            DDPrint.PrintLine("INPUT TILE: " + InputTileFlag);
            DDPrint.PrintLine("INPUT ENEMY: " + InputEnemyFlag);

            DDPrint.PrintLine("DISPLAY WALL: " + DisplayWallFlag);
            DDPrint.PrintLine("DISPLAY TILE: " + DisplayTileFlag);
            DDPrint.PrintLine("DISPLAY ENEMY: " + DisplayEnemyFlag);

            DDPrint.PrintLine("WALL: " + Wall);
            DDPrint.PrintLine("TILE: " + TileIndex + " / " + MapTileManager.GetCount());
            DDPrint.PrintLine("TILE=[" + MapTileManager.GetNames()[TileIndex] + "]");
            DDPrint.PrintLine("ENEMY: " + EnemyIndex + " / " + EnemyManager.GetCount());
            DDPrint.PrintLine("ENEMY=[" + EnemyManager.GetNames()[EnemyIndex] + "]");

            I2Point pt   = Map.ToTablePoint(DDMouse.X + DDGround.ICamera.X, DDMouse.Y + DDGround.ICamera.Y);
            MapCell cell = Game.I.Map.GetCell(pt);

            DDPrint.PrintLine("CURSOR: " + pt.X + ", " + pt.Y);
            DDPrint.PrintLine("CURSOR WALL: " + cell.Wall);
            DDPrint.PrintLine("CURSOR TILE=[" + (cell.Tile == null ? "" : cell.Tile.Name) + "]");
            DDPrint.PrintLine("CURSOR ENEMY=[" + (cell.EnemyLoader == null ? "" : cell.EnemyLoader.Name) + "]");

            DDPrint.PrintLine("");
            DDPrint.PrintLine("キー操作");
            DDPrint.PrintLine("C = COPY");
            DDPrint.PrintLine("S = SAVE");
        }
Example #7
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);
                }
            }
Example #8
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);
            }
        }
Example #9
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);
            }
        }
Example #10
0
        public void Test01()
        {
            for (; ;)
            {
                if (DDInput.PAUSE.GetInput() == 1)
                {
                    Ground.I.Music.MUS_TITLE.Play();
                }
                if (DDInput.A.GetInput() == 1)
                {
                    Ground.I.Music.MUS_STAGE_01.Play();
                }
                if (DDInput.B.GetInput() == 1)
                {
                    Ground.I.Music.MUS_BOSS_01.Play();
                }
                if (DDInput.C.GetInput() == 1)
                {
                    Ground.I.Music.MUS_STAGE_02.Play();
                }
                if (DDInput.D.GetInput() == 1)
                {
                    Ground.I.Music.MUS_BOSS_02.Play();
                }

                DDCurtain.DrawCurtain();

                DDPrint.SetPrint();
                DDPrint.Print("音量テスト");

                DDEngine.EachFrame();
            }
        }
Example #11
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);
            }
        }
Example #12
0
        public void Perform()
        {
            DDUtils.SetMouseDispMode(false);
            DDEngine.FreezeInput(10);

            double x     = DDConsts.Screen_W / 2;
            double y     = DDConsts.Screen_H / 2;
            double speed = SPEED_DEF;

            for (; ;)
            {
                DDMouse.UpdateMove();

                x += DDMouse.MoveX * speed;
                y += DDMouse.MoveY * speed;

                DDUtils.ToRange(ref x, 0, DDConsts.Screen_W - 1);
                DDUtils.ToRange(ref y, 0, DDConsts.Screen_H - 1);

                int ix = DoubleTools.ToInt(x);
                int iy = DoubleTools.ToInt(y);

                if (DDKey.IsPound(DX.KEY_INPUT_Z))
                {
                    speed += SPEED_CHANGE_STEP;
                }

                if (DDKey.IsPound(DX.KEY_INPUT_X))
                {
                    speed -= SPEED_CHANGE_STEP;
                }

                DDUtils.ToRange(ref speed, SPEED_MIN, SPEED_MAX);

                if (DDMouse.L.GetInput() == -1)
                {
                    break;
                }

                DDCurtain.DrawCurtain();

                DDPrint.SetPrint(0, 0, 24);
                DDPrint.PrintLine("★マウスカーソルを奪う");
                DDPrint.PrintLine("X=" + x.ToString("F3"));
                DDPrint.PrintLine("Y=" + y.ToString("F3"));
                DDPrint.PrintLine("Speed=" + speed);
                DDPrint.PrintLine("左クリックでメニューに戻る。");
                DDPrint.PrintLine("Zキー:速度上げ");
                DDPrint.PrintLine("Xキー:速度下げ");

                DDDraw.SetBright(new I3Color(255, 128, 0));
                DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, ix, iy - CROSS_WH / 2, 1, CROSS_WH);
                DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, ix - CROSS_WH / 2, iy, CROSS_WH, 1);
                DDDraw.Reset();

                DDEngine.EachFrame();
            }
            DDUtils.SetMouseDispMode(true);
        }
Example #13
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();
            }
        }
Example #14
0
        public void Perform()
        {
            DDUtils.SetMouseDispMode(true);

            string line1 = "";
            string line2 = "";
            string line3 = "";

            for (; ;)
            {
                DDMouse.UpdatePos();

                if (DDMouse.L.GetInput() == 1)
                {
                    if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(50, 50, 50, 16)) == false)
                    {
                        line1 = EditString("LINE-1 (70 bytes)", line1, 70, '-');
                    }
                    else if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(50, 150, 50, 16)) == false)
                    {
                        line2 = EditString("LINE-2 (ASCII only, 50 bytes)", line2, 50, 'A');
                    }
                    else if (DDUtils.IsOut(new D2Point(DDMouse.X, DDMouse.Y), new D4Rect(50, 250, 50, 16)) == false)
                    {
                        line3 = EditString("LINE-3 (DIGIT only, 10 bytes)", line3, 10, '9');
                    }
                }

                DDCurtain.DrawCurtain();

                DX.DrawBox(0, 0, DDConsts.Screen_W, 100, DX.GetColor(60, 60, 60), 1);
                DX.DrawBox(0, 100, DDConsts.Screen_W, 200, DX.GetColor(60, 90, 30), 1);
                DX.DrawBox(0, 200, DDConsts.Screen_W, 300, DX.GetColor(60, 30, 90), 1);

                DDPrint.SetPrint(50, 50);
                DDPrint.Print("[EDIT]");

                DDPrint.SetPrint(150, 50);
                DDPrint.Print(line1);

                DDPrint.SetPrint(50, 150);
                DDPrint.Print("[EDIT]");

                DDPrint.SetPrint(150, 150);
                DDPrint.Print(line2);

                DDPrint.SetPrint(50, 250);
                DDPrint.Print("[EDIT]");

                DDPrint.SetPrint(150, 250);
                DDPrint.Print(line3);

                DDEngine.EachFrame();
            }
        }
Example #15
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();
        }
Example #16
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);
            });
        }
Example #17
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();
            }
        }
Example #18
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));
            }
        }
Example #19
0
        private void DrawTrackBar(int x, int y, string lwLabel, string hiLabel, double rate, Action <double> changed, Action pulse = null)
        {
            DDDraw.DrawBegin(Ground.I.Picture.TrackBar, x, y);
            DDCrash drawedCrash = DDDraw.DrawGetCrash();

            DDDraw.DrawEnd();

            DDPrint.SetPrint(x - Ground.I.Picture.TrackBar.Get_W() / 2 - lwLabel.Length * 32, y - 15);
            DDPrint.Print(lwLabel);

            DDPrint.SetPrint(x + Ground.I.Picture.TrackBar.Get_W() / 2, y - 15);
            DDPrint.Print(hiLabel);

            double span = Ground.I.Picture.TrackBar.Get_W() - Ground.I.Picture.TrackBar_つまみ.Get_W();

            span /= 2;
            double xMin = x - span;
            double xMax = x + span;

            double xつまみ = DDUtils.AToBRate(xMin, xMax, rate);

            DDDraw.DrawCenter(Ground.I.Picture.TrackBar_つまみ, xつまみ, y);

            if (drawedCrash.IsCrashed(DDCrashUtils.Point(new D2Point(DDMouse.X, DDMouse.Y))))
            {
                this.LastHoveringTrackBar = drawedCrash;
            }
            if (
                this.LastActiveTrackBar != null &&
                this.LastActiveTrackBar.Value.IsCrashed(DDCrashUtils.Point(new D2Point(x, y)))
                )
            {
                double rateNew = DDUtils.RateAToB(xMin, xMax, DDMouse.X);
                DDUtils.ToRange(ref rateNew, 0.0, 1.0);

                if (SCommon.MICRO < Math.Abs(rate - rateNew))
                {
                    changed(rateNew);
                }

                if (pulse != null)
                {
                    const int PULSE_FRM = 60;

                    if (DDEngine.ProcFrame % PULSE_FRM == 0)
                    {
                        pulse();
                    }
                }
            }
        }
Example #20
0
        public void Perform()
        {
            StringBuilder buff = new StringBuilder(100);             // マージンどんくらい要るの?

            //StringBuilder buff = new StringBuilder(30);

            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            int inputHdl = DX.MakeKeyInput(30, 1, 0, 0); // ハンドル生成

            DX.SetActiveKeyInput(inputHdl);              // 入力開始

            for (; ;)
            {
                if (DX.CheckKeyInput(inputHdl) != 0)                 // 入力終了
                {
                    break;
                }

                DDCurtain.DrawCurtain();

                DX.DrawKeyInputModeString(100, 100);                 // IMEモードとか表示

                DX.GetKeyInputString(buff, inputHdl);                // 現状の文字列を取得

                DDPrint.SetPrint(100, 200);
                DDPrint.Print(buff.ToString());

                DX.DrawKeyInputString(100, 300, inputHdl);                 // 入力中の文字列の描画

                DDEngine.EachFrame();
            }
            DX.DeleteKeyInput(inputHdl);             // ハンドル開放

            DDCurtain.SetCurtain(30, -1.0);

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

                DDPrint.SetPrint(100, 200);
                DDPrint.Print(buff.ToString());

                DDEngine.EachFrame();
            }

            DDEngine.FreezeInput();
        }
Example #21
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();
            }
        }
Example #22
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();
                        }
                    }
                }
            }
        }
Example #23
0
        public static void Perform()
        {
            DDCurtain.SetCurtain();

            foreach (DDScene scene in DDSceneUtils.Create(120))
            {
                // TODO: 3秒後あたりから L でスキップできるようにする。

                DDCurtain.DrawCurtain();

                DDPrint.SetPrint();
                DDPrint.Print("Ending_死亡");

                DDEngine.EachFrame();
            }
        }
Example #24
0
        public override void DrawWall(double cam_x, double cam_y, double cam_xRate, double cam_yRate)
        {
            DDDraw.SetBright(new I3Color(0, 0, 20));
            DDDraw.DrawRect(Ground.I.Picture.WhiteBox, 0, 0, DDConsts.Screen_W, DDConsts.Screen_H);
            DDDraw.Reset();

            if (DDEngine.ProcFrame % 90 == 0)
            {
                波紋効果.Addマップ下部から炎();
            }

            DDGround.EL.Add(() =>
            {
                double map_b = Game.I.Map.H * GameConsts.TILE_H;
                double cam_b = DDGround.Camera.Y + DDConsts.Screen_H;

                double y = map_b - cam_b;
                y       *= 0.5;
                y        = DDConsts.Screen_H - Ground.I.Picture.WallFire.Get_H() + y;

                DDDraw.SetBright(new I3Color(255, 0, 0));
                DDDraw.DrawSimple(Ground.I.Picture.WallFire, 0, y);
                DDDraw.Reset();

                if (DDEngine.ProcFrame % 20 == 0)
                {
                    double yy = map_b - cam_b;
                    yy       /= 2000.0;
                    yy        = 1.0 - yy;
                    DDUtils.ToRange(ref yy, 0.0, 1.0);
                    yy = 0.3 + yy * 0.7;

                    // yy == 0.3 ~ 1.0 == 高い位置 ~ 低い位置

                    if (DDConfig.LOG_ENABLED)
                    {
                        DDGround.EL.Keep(10, () =>
                        {
                            DDPrint.SetPrint(0, 16);
                            DDPrint.DebugPrint("yy: " + yy);
                        });
                    }
                    DDMusicUtils.Fade(10, yy);
                }
                return(false);
            });
        }
Example #25
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);
            }
        }
Example #26
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.SetPrint((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);
            }
        }
Example #27
0
        public void Test01()
        {
            for (; ;)
            {
                DDCurtain.DrawCurtain();

                DDPrint.SetPrint(); DDPrint.Print("RETURN ==> " + DDKey.GetInput(DX.KEY_INPUT_RETURN));
                DDPrint.PrintRet(); DDPrint.Print("SPACE  ==> " + DDKey.GetInput(DX.KEY_INPUT_SPACE));
                DDPrint.PrintRet(); DDPrint.Print("Z      ==> " + DDKey.GetInput(DX.KEY_INPUT_Z));
                DDPrint.PrintRet(); DDPrint.Print("X      ==> " + DDKey.GetInput(DX.KEY_INPUT_X));
                DDPrint.PrintRet(); DDPrint.Print("DIR_4  ==> " + DDKey.GetInput(DX.KEY_INPUT_LEFT));
                DDPrint.PrintRet(); DDPrint.Print("DIR_6  ==> " + DDKey.GetInput(DX.KEY_INPUT_RIGHT));
                DDPrint.PrintRet(); DDPrint.Print("DIR_8  ==> " + DDKey.GetInput(DX.KEY_INPUT_UP));
                DDPrint.PrintRet(); DDPrint.Print("DIR_2  ==> " + DDKey.GetInput(DX.KEY_INPUT_DOWN));

                DDEngine.EachFrame();
            }
        }
Example #28
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();
        }
Example #29
0
        public void Test01()
        {
            for (; ;)
            {
                DDCurtain.DrawCurtain();

                DDPrint.SetPrint();

                DDPrint.Print("PrimaryPadId: " + DDGround.PrimaryPadId);
                DDPrint.PrintRet();

                for (int btnId = 0; btnId < DDPad.PAD_BUTTON_MAX; btnId++)
                {
                    DDPrint.Print(btnId + " ==> " + DDPad.GetInput(DDGround.PrimaryPadId, btnId));
                    DDPrint.PrintRet();
                }
                DDEngine.EachFrame();
            }
        }
Example #30
0
        private string EditString(string prompt, string initValue, int maxlen, char mode)
        {
            StringBuilder buff = new StringBuilder(maxlen * 3);             // HACK: 必要なバッファ長が不明

            DDCurtain.SetCurtain();
            DDEngine.FreezeInput();

            int inputHdl = DX.MakeKeyInput((uint)maxlen, 1, mode == 'A' ? 1 : 0, mode == '9' ? 1 : 0); // ハンドル生成

            DX.SetActiveKeyInput(inputHdl);                                                            // 入力開始

            DX.SetKeyInputString(initValue, inputHdl);                                                 // 初期値設定

            for (; ;)
            {
                if (DX.CheckKeyInput(inputHdl) != 0)                 // 入力終了
                {
                    break;
                }

                DDCurtain.DrawCurtain();
                DX.DrawBox(0, 0, DDConsts.Screen_W, 250, DX.GetColor(30, 90, 90), 1);

                DDPrint.SetPrint(50, 50);
                DDPrint.Print("InputString > " + prompt);

                DX.DrawKeyInputModeString(50, 100);                 // IMEモードとか表示

                DX.GetKeyInputString(buff, inputHdl);               // 現状の文字列を取得

                DDPrint.SetPrint(50, 150);
                DDPrint.Print(buff.ToString());

                DX.DrawKeyInputString(50, 200, inputHdl);                 // 入力中の文字列の描画

                DDEngine.EachFrame();
            }
            DX.DeleteKeyInput(inputHdl);             // ハンドル開放

            DDEngine.FreezeInput();

            return(buff.ToString());
        }