예제 #1
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);
                }
            }
예제 #2
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();
            }
        }
예제 #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.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)));
            }
        }
예제 #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++)
                {
                    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);
                }
            }
예제 #5
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();
            }
        }
예제 #6
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);
            }
        }
예제 #7
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();
            }
        }
예제 #8
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();
        }
예제 #9
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();
        }
예제 #10
0
        public static void DebugPrint(object message)
        {
#if DEBUG
            string line = "_" + message;

            DDGround.EL.Add(() =>
            {
                DDPrint.Print(line);
                return(false);
            });
#endif
        }
예제 #11
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);
            });
        }
예제 #12
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));
            }
        }
예제 #13
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();
                    }
                }
            }
        }
예제 #14
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();
        }
예제 #15
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();
            }
        }
예제 #16
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();
                        }
                    }
                }
            }
        }
예제 #17
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();
            }
        }
예제 #18
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();
            }
        }
예제 #19
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);
            }
        }
예제 #20
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);
            }
        }
예제 #21
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();
            }
        }
예제 #22
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();
            }
        }
예제 #23
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());
        }
예제 #24
0
        private void DrawMap()
        {
            int cell_wh = 400 / Math.Max(this.Map.W, this.Map.H);

            if (cell_wh < 1)
            {
                throw null;                 // 2bs?
            }
            for (int x = -1; x <= this.Map.W; x++)
            {
                for (int y = -1; y <= this.Map.H; y++)
                {
                    int l = (DDConsts.Screen_W - cell_wh * this.Map.W) / 2;
                    int t = (DDConsts.Screen_H - cell_wh * this.Map.H) / 2;

                    I3Color color = new I3Color(64, 64, 64);

                    if (this.Map.DungeonMap[x, y].Wall)
                    {
                        color = new I3Color(200, 200, 50);
                    }

                    if (this.Map.DungeonMap[x, y].Goal)
                    {
                        color = new I3Color(255, 0, 0);
                    }

                    if (x == this.Map.DungeonMap.StartPoint.X && y == this.Map.DungeonMap.StartPoint.Y)
                    {
                        color = new I3Color(0, 128, 255);
                    }

                    DDDraw.SetBright(color);
                    DDDraw.DrawRect(DDGround.GeneralResource.WhiteBox, l + x * cell_wh, t + y * cell_wh, cell_wh, cell_wh);
                    DDDraw.Reset();
                }
            }

            // zantei
            DDPrint.SetPrint();
            DDPrint.Print("※ [青]=スタート地点 , [赤]=ゴール地点 , 上方向が北 ( パラメータ=" + this.Map.DungeonMap.ParameterString + " )");
        }
예제 #25
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);
            });
        }
예제 #26
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();
                    }
                }
            }
        }
예제 #27
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));                // カメラから出たら消滅する。
            }
        }
예제 #28
0
파일: Program.cs 프로젝트: stackprobe/Fairy
        private void Test01()
        {
            for (; ;)
            {
                if (DDInput.A.GetInput() == 1)
                {
                    break;
                }

                DDCurtain.DrawCurtain();

                DDPrint.SetPrint();
                DDPrint.Print("FrameProcessingMillis: " + DDEngine.FrameProcessingMillis);

                DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0);
                DDDraw.DrawZoom(10.0);
                DDDraw.DrawRotate(DDEngine.ProcFrame / 20.0);
                DDDraw.DrawEnd();

                DDEngine.EachFrame();
            }
        }
예제 #29
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));                // カメラから出たら消滅する。
            }
        }
예제 #30
0
        public void Main01()
        {
            FileTools.Delete(W_DIR);
            FileTools.CreateDir(W_DIR);

            this.SpData = new SpectrumData(Path.Combine(R_DIR, "Spectrum.csv"));

            while (this.Frame < this.SpData.Rows.Length)
            {
                double[] row = this.SpData.Rows[this.Frame];

                DDCurtain.DrawCurtain();
                DDPrint.SetPrint(0, 20, 23);

                for (int index = 0; index < 45; index++)
                {
                    double lv = 0.0;

                    for (int c = 0; c < 2; c++)
                    {
                        lv += row[index * 2 + c];
                    }

                    int iLv = DoubleTools.ToInt(lv * 145.0);

                    for (int c = 0; c < iLv; c++)
                    {
                        DDPrint.Print("*");
                    }

                    DDPrint.PrintRet();
                }

                this.MG_EachFrame();
            }
        }