Exemplo n.º 1
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                this.X += 8.0 * (this.FacingLeft ? -1 : 1);

                DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawZoom(0.1);
                DDDraw.DrawEnd();

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

                yield return(true);
            }
        }
Exemplo n.º 2
0
        private static IEnumerable <bool> E_残像()
        {
            foreach (DDScene scene in DDSceneUtils.Create(30))
            {
                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.8);
                //DDDraw.DrawSimple(EL_Screen.ToPicture(), 0, 0);
                DDDraw.DrawBegin(EL_Screen.ToPicture(), DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
                DDDraw.DrawZoom(1.0 + scene.Rate * 0.1);
                DDDraw.DrawRotate(scene.Rate * 0.03);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 3
0
        public static IEnumerable <bool> EnemyDead(double x, double y)
        {
            double r = DDUtils.Random.Real() * Math.PI * 2.0;

            foreach (DDScene scene in DDSceneUtils.Create(19))
            {
                DDDraw.SetAlpha(0.7);
                DDDraw.DrawBegin(Ground.I.Picture2.D_ENEMYDIE_00_BGRA[scene.Numer / 2], x, y);
                DDDraw.DrawRotate(r);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 4
0
        private IEnumerable <bool> E_出現エフェクト()
        {
            int frameMax;

            if (Game.I.Player.DeadFrame != 0)             // ? プレイヤー死亡
            {
                frameMax = 40;
            }
            else
            {
                frameMax = 20;
            }

            double x = this.X;
            double y = this.Y;
            double zoom;

            if (Game.I.Player.DeadFrame != 0)             // ? プレイヤー死亡
            {
                zoom = 4.0;
            }
            else
            {
                zoom = 2.0;
            }

            foreach (DDScene scene in DDSceneUtils.Create(frameMax))
            {
                DDDraw.SetAlpha((1.0 - scene.Rate) * 0.2);
                DDDraw.SetBright(new I3Color(255, 0, 0));

                for (int c = 0; c < 5; c++)
                {
                    DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, x - DDGround.ICamera.X, y - DDGround.ICamera.Y);
                    DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
                    DDDraw.DrawZoom_X(1.0 + DDUtils.Random.Real() * zoom);
                    DDDraw.DrawZoom_Y(1.0 + DDUtils.Random.Real() * zoom);
                    DDDraw.DrawSlide(
                        DDUtils.Random.DReal() * 10.0 * zoom,
                        DDUtils.Random.DReal() * 10.0 * zoom
                        );
                    DDDraw.DrawEnd();
                }
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 5
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();
                        }
                    }
                }
            }
        }
Exemplo n.º 6
0
            private IEnumerable <bool> E_DrawPiace(DrawPosInfo drawPos_1, DrawPosInfo drawPos_2, int frameMax)
            {
                foreach (DDScene scene in DDSceneUtils.Create(frameMax))
                {
                    double scRate = DDUtils.SCurve(scene.Rate);
                    double x      = GameConsts.FIELD_L + DDUtils.AToBRate(drawPos_1.X, drawPos_2.X, scRate);
                    double y      = GameConsts.FIELD_T + DDUtils.AToBRate(drawPos_1.Y, drawPos_2.Y, scRate);
                    double rot    = DDUtils.AToBRate(drawPos_1.Rot, drawPos_2.Rot, scRate);

                    DDDraw.DrawBegin(this.Picture, x, y);
                    DDDraw.DrawRotate(rot);
                    DDDraw.DrawEnd();

                    yield return(true);
                }
            }
Exemplo n.º 7
0
        public static IEnumerable <bool> 閉鎖_開放(double x, double y)
        {
            foreach (DDScene scene in DDSceneUtils.Create(15))
            {
                DDDraw.SetAlpha(0.5);
                DDDraw.SetBright(0.0, 1.0, 1.0);
                DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, x - DDGround.ICamera.X, y - DDGround.ICamera.Y);
                DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
                DDDraw.DrawZoom(1.0 - scene.Rate * 0.5);
                DDDraw.DrawRotate(Math.PI * 2.0 * scene.Rate);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 8
0
        public static IEnumerable <bool> ShotDead(double x, double y, double r)
        {
            double z = r / 8.0;

            foreach (DDScene scene in DDSceneUtils.Create(11))
            {
                DDDraw.SetAlpha(0.4);
                DDDraw.DrawBegin(Ground.I.Picture2.D_BLAST_00[scene.Numer / 3], x, y - scene.Numer * 5.0);
                DDDraw.DrawSlide(8.0, -8.0);
                DDDraw.DrawZoom(z);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 9
0
        public override void DrawWall(double cam_x, double cam_y, double cam_xRate, double cam_yRate)
        {
            // HACK: 重い!

            const int WALL_TILE_WH = 28;

            int l = -(int)(cam_x / 10.0);
            int t = -(int)(cam_y / 10.0);

            for (int x = 0; l + x * WALL_TILE_WH < DDConsts.Screen_W; x++)
            {
                int draw_l = l + x * WALL_TILE_WH;
                int draw_r = draw_l + WALL_TILE_WH;

                if (draw_r <= 0)
                {
                    continue;
                }

                for (int y = 0; t + y * WALL_TILE_WH < DDConsts.Screen_H; y++)
                {
                    int draw_t = t + y * WALL_TILE_WH;
                    int draw_b = draw_t + WALL_TILE_WH;

                    if (draw_b <= 0)
                    {
                        continue;
                    }

                    //DX.DrawBox(draw_l, draw_t, draw_r, draw_b, (x + y) % 2 == 0 ? DX.GetColor(0, 0, 32) : DX.GetColor(32, 32, 64), 1);

                    if ((x + y) % 2 == 0)
                    {
                        DDDraw.SetBright(new I3Color(32, 32, 48));
                    }
                    else
                    {
                        DDDraw.SetBright(new I3Color(48, 48, 64));
                    }

                    DDDraw.DrawBeginRect_LTRB(Ground.I.Picture.WhiteBox, draw_l, draw_t, draw_r, draw_b);
                    DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();
                }
            }
        }
Exemplo n.º 10
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);
            }
        }
Exemplo n.º 11
0
        private static void DrawWall()
        {
            DDUtils.Approach(ref WallBokashiRate, WallBokashiRateDest, 0.93);
            DDUtils.Approach(ref WallZRate, WallZRateDest, 0.9);

            // ---

            DDSubScreenUtils.ChangeDrawScreen(WorkScreen);
            DDDraw.DrawBegin(Ground.I.Picture.TitleWall, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0);
            DDDraw.DrawZoom(WallZRate);
            DDDraw.DrawEnd();
            DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, DoubleTools.ToInt(WallBokashiRate * 1000.0));             // 1
            DX.GraphFilter(WorkScreen.GetHandle(), DX.DX_GRAPH_FILTER_GAUSS, 16, DoubleTools.ToInt(WallBokashiRate * 1000.0));             // 2
            DDSubScreenUtils.RestoreDrawScreen();

            DDDraw.DrawSimple(DDPictureLoaders2.Wrapper(WorkScreen), 0, 0);
        }
Exemplo n.º 12
0
            private IEnumerable <bool> E_Block()
            {
                double x = DDUtils.Random.Real() * DDConsts.Screen_W;
                double b = DDUtils.Random.Real() * 0.2;

                foreach (DDScene scene in DDSceneUtils.Create(60))
                {
                    DDDraw.SetAlpha(0.5);
                    DDDraw.SetBright(b, b, b);
                    DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, x, (1.0 - scene.Rate) * (DDConsts.Screen_H + this.Block_H) - (this.Block_H / 2));
                    DDDraw.DrawSetSize(this.Block_W, this.Block_H);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();

                    yield return(true);
                }
            }
Exemplo n.º 13
0
        public override void DrawTile(MapCell cell, int cell_x, int cell_y, double draw_x, double draw_y)
        {
            if (
                cell.Kind == MapCell.Kind_e.WALL ||
                cell.Kind == MapCell.Kind_e.WALL_ENEMY_THROUGH ||
                cell.IsCookie()
                )
            {
                if ((cell_x + cell_y) % 2 == 0)
                {
                    DDDraw.SetBright(new I3Color(128, 192, 255));
                }
                else
                {
                    DDDraw.SetBright(new I3Color(100, 150, 200));
                }

                DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, draw_x, draw_y);
                DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                if (cell.IsCookie())
                {
                    DDDraw.SetBright(new I3Color(200, 230, 255));
                    DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, draw_x, draw_y);
                    DDDraw.DrawSetSize(GameConsts.TILE_W / 2, GameConsts.TILE_H / 2);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();
                }
            }
            else if (cell.Kind == MapCell.Kind_e.GOAL)
            {
                double bright = Math.Sin(DDEngine.ProcFrame / 10.0) * 0.4 + 0.6;

                DDDraw.SetBright(
                    bright * 0.5,
                    bright * 0.9,
                    bright * 1.0
                    );
                DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, draw_x, draw_y);
                DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
                DDDraw.DrawEnd();
                DDDraw.Reset();
            }
        }
Exemplo n.º 14
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                DDDraw.DrawBegin(this.Picture, DDConsts.Screen_W / 2.0, DDConsts.Screen_H / 2.0);
                DDDraw.DrawZoom(this.Zoom);
                DDDraw.DrawSlide(
                    ((Game.I.Map.W * GameConsts.TILE_W - DDConsts.Screen_W) / 2.0 - DDGround.Camera.X) * SLIDE_RATE,
                    ((Game.I.Map.H * GameConsts.TILE_H - DDConsts.Screen_H) / 2.0 - DDGround.Camera.Y) * SLIDE_RATE
                    );
                DDDraw.DrawEnd();

                DDCurtain.DrawCurtain(-0.5);

                yield return(true);
            }
        }
Exemplo n.º 15
0
        private IEnumerable <bool> E_HitBack()
        {
            foreach (DDScene scene in DDSceneUtils.Create(20))
            {
                double xBuru = (DDUtils.Random.Real() - 0.5) * 2 * 10.0;
                double yBuru = (DDUtils.Random.Real() - 0.5) * 2 * 10.0;

                bool facingLeft = Game.I.Player.X < this.X;

                DDDraw.DrawBegin(Ground.I.Picture2.Enemy_神奈子[12], this.X + xBuru, this.Y + yBuru);
                DDDraw.DrawSlide(20.0, -10.0);
                DDDraw.DrawZoom_X(facingLeft ? 1 : -1);
                DDDraw.DrawEnd();

                yield return(true);
            }
        }
Exemplo n.º 16
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (int frame = 0; ; frame++)
            {
                if (2 * 4 < frame && DDInput.B.GetInput() == 1)                 // ? 再発砲
                {
                    frame = 0;
                }

                int koma = Math.Min(frame / 4, Ground.I.Picture2.さやか滞空攻撃.Length - 1);

                AttackCommon.ProcPlayer_移動();
                AttackCommon.ProcPlayer_Fall();

                AttackCommon.ProcPlayer_側面();
                AttackCommon.ProcPlayer_脳天();

                if (AttackCommon.ProcPlayer_接地())
                {
                    break;
                }

                double xZoom = Game.I.Player.FacingLeft ? -1.0 : 1.0;

                if (frame == 2 * 4)
                {
                    Game.I.Shots.Add(new Shot_さやか滞空攻撃(
                                         Game.I.Player.X + 50.0 * xZoom,
                                         Game.I.Player.Y,
                                         Game.I.Player.FacingLeft
                                         ));
                }

                DDDraw.SetTaskList(Game.I.Player.Draw_EL);
                DDDraw.DrawBegin(
                    Ground.I.Picture2.さやか滞空攻撃[koma],
                    Game.I.Player.X - DDGround.ICamera.X,
                    Game.I.Player.Y - DDGround.ICamera.Y
                    );
                DDDraw.DrawZoom_X(xZoom);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 17
0
        public void Draw_02()
        {
            if (1 <= this.DeadFrame)
            {
                this.DrawOnDead((double)this.DeadFrame / GameConsts.PLAYER_DEAD_FRAME_MAX);
                return;
            }
            if (1 <= this.RebornFrame)
            {
                this.DrawOnDead(1.0 - (double)this.RebornFrame / GameConsts.PLAYER_REBORN_FRAME_MAX);
                return;
            }

            DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, SCommon.ToInt(this.X - DDGround.ICamera.X), SCommon.ToInt(this.Y - DDGround.ICamera.Y));
            DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
            DDDraw.DrawEnd();
        }
Exemplo n.º 18
0
        protected override IEnumerable <bool> E_Draw()
        {
            D2Point speed = DDUtils.AngleToPoint(this.Rad + this.RadZure, 3.0);

            for (int frame = 0; frame < 90; frame++)
            {
                speed *= 0.95;

                this.X += speed.X;
                this.Y += speed.Y;

                DDDraw.DrawBegin(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.NORMAL, this.Color), this.X, this.Y);
                DDDraw.DrawRotate(this.Rad + Math.PI / 2.0);
                DDDraw.DrawEnd();

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

                yield return(true);
            }

            {
                double xa;
                double ya;

                DDUtils.MakeXYSpeed(this.X, this.Y, Game.I.Player.X, Game.I.Player.Y, 3.0, out xa, out ya);
                DDUtils.Rotate(ref xa, ref ya, this.RadZure);

                speed.X = xa;
                speed.Y = ya;
            }

            for (; ;)
            {
                this.X += speed.X;
                this.Y += speed.Y;

                DDDraw.DrawBegin(EnemyCommon.GetTamaPicture(EnemyCommon.TAMA_KIND_e.NORMAL, this.Color), this.X, this.Y);
                DDDraw.DrawRotate(this.Rad + Math.PI / 2.0);
                DDDraw.DrawEnd();

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

                yield return(!EnemyCommon.IsEvacuated(this));
            }
        }
Exemplo n.º 19
0
        protected override IEnumerable <bool> E_Draw()
        {
            int zureX = 0;
            int zureY = -16;

            for (int frame = 0; ; frame++)
            {
                //int koma = frame;
                //int koma = frame / 2;
                int koma = frame / 3;

                if (Ground.I.Picture2.Tewi_しゃがみ強攻撃.Length <= koma)
                {
                    break;
                }

                if (frame == 5 * 3)
                {
                    Game.I.Player.X += 54 * (Game.I.Player.FacingLeft ? -1.0 : 1.0);
                    zureX            = 16;
                }

                double x          = Game.I.Player.X + zureX * (Game.I.Player.FacingLeft ? -1.0 : 1.0);
                double y          = Game.I.Player.Y + zureY;
                double xZoom      = Game.I.Player.FacingLeft ? -1.0 : 1.0;
                bool   facingLeft = Game.I.Player.FacingLeft;

                if (frame == 6 * 3)
                {
                    // TODO: 当たり判定設定
                }

                DDDraw.SetTaskList(Game.I.Player.Draw_EL);
                DDDraw.DrawBegin(
                    Ground.I.Picture2.Tewi_しゃがみ強攻撃[koma],
                    x - DDGround.ICamera.X,
                    y - DDGround.ICamera.Y
                    );
                DDDraw.DrawZoom_X(xZoom);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                yield return(true);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 21
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                this.X += this.XAdd;
                this.Y += this.YAdd;

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

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

                yield return(true);
            }
        }
Exemplo n.º 22
0
                private IEnumerable <bool> E_Move(double sx, double sy, double dx, double dy, double sRot, double dRot)
                {
                    foreach (DDScene scene in DDSceneUtils.Create(DDUtils.Random.GetRange(20, 60)))
                    {
                        DDDraw.SetBright(_color);
                        DDDraw.DrawBegin(
                            Ground.I.Picture.WhiteBox,
                            DDUtils.AToBRate(sx, dx, DDUtils.SCurve(scene.Rate)),
                            DDUtils.AToBRate(sy, dy, DDUtils.SCurve(scene.Rate))
                            );
                        DDDraw.DrawSetSize(TILE_W, TILE_H);
                        DDDraw.DrawRotate(DDUtils.AToBRate(sRot, dRot, DDUtils.SCurve(scene.Rate)));
                        DDDraw.DrawEnd();
                        DDDraw.Reset();

                        yield return(true);
                    }
                }
Exemplo n.º 23
0
        protected override IEnumerable <bool> E_Draw()
        {
            D2Point speed = GameCommon.GetXYSpeed(this.Direction, 10.0);

            for (int frame = 0; ; frame++)
            {
                this.X += speed.X;
                this.Y += speed.Y;

                DDDraw.DrawBegin(Ground.I.Picture.Dummy, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawRotate(frame / 2.0);
                DDDraw.DrawEnd();

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

                yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y)));                // カメラの外に出たら(画面から見えなくなったら)消滅する。
            }
        }
Exemplo n.º 24
0
        protected override IEnumerable <bool> E_Draw()
        {
            D2Point speed        = GameCommon.GetXYSpeed(this.Direction, 8.0);
            int     bouncedCount = 0;

            for (int frame = 0; ; frame++)
            {
                this.X += speed.X;
                this.Y += speed.Y;

                if (this.壁をすり抜ける)                 // ? 跳ね返り可能
                {
                    bool bounced = false;

                    if (this.IsInsideWall(-10, 0) || this.IsInsideWall(10, 0))
                    {
                        speed.X *= -1.0;
                        bounced  = true;
                    }
                    if (this.IsInsideWall(0, -10) || this.IsInsideWall(0, 10))
                    {
                        speed.Y *= -1.0;
                        bounced  = true;
                    }
                    if (bounced)
                    {
                        DDGround.EL.Add(SCommon.Supplier(Effects.跳ねた(this.X, this.Y)));
                        bouncedCount++;

                        if (BOUNCE_MAX <= bouncedCount)
                        {
                            this.壁をすり抜ける = false;
                        }
                    }
                }
                DDDraw.DrawBegin(Ground.I.Picture2.IconSet[0, 35], this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawRotate(frame / 2.0);
                DDDraw.DrawEnd();

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

                yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y)));                // カメラの外に出たら(画面から見えなくなったら)消滅する。
            }
        }
Exemplo n.º 25
0
        protected override IEnumerable <bool> E_Draw()
        {
            for (int frame = 0; ; frame++)
            {
                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);

                if (DDUtils.GetDistance(Game.I.Player.X - this.X, Game.I.Player.Y - this.Y) < 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))
                {
                    {
                        double xZoom = this.Speed.X < 0.0 ? -1.0 : 1.0;

                        DDDraw.DrawBegin(
                            new DDPicture[]
                        {
                            Ground.I.Picture.Enemy_B0001_01,
                            Ground.I.Picture.Enemy_B0001_02,
                            Ground.I.Picture.Enemy_B0001_03,
                            Ground.I.Picture.Enemy_B0001_04,
                        }
                            [frame / 5 % 4],
                            this.X - DDGround.ICamera.X,
                            this.Y - DDGround.ICamera.Y
                            );
                        DDDraw.DrawZoom_X(xZoom);
                        DDDraw.DrawEnd();
                    }

                    // 当たり判定ナシ
                }
                yield return(true);
            }
        }
Exemplo n.º 26
0
        private void DrawButton(int x, int y, DDPicture picture, bool activeFlag)
        {
            DDDraw.SetAlpha(activeFlag ? 1.0 : 0.5);
            DDDraw.DrawBegin(picture, x, y);
            DDCrash drawedCrash = DDDraw.DrawGetCrash();

            DDDraw.DrawEnd();
            DDDraw.Reset();

            if (drawedCrash.IsCrashed(DDCrashUtils.Point(new D2Point(DDMouse.X, DDMouse.Y))))
            {
                this.LastHoveringButton     = picture;
                this.LastButtonHoveringFlag = true;
            }
            else
            {
                this.LastButtonHoveringFlag = false;
            }
        }
Exemplo n.º 27
0
        public override void DrawTile(MapCell cell, int cell_x, int cell_y, double draw_x, double draw_y)
        {
            if (cell.Kind == MapCell.Kind_e.WALL)
            {
                double bure_x = Math.Sin((DDEngine.ProcFrame + cell_x + cell_y) * 0.05) * 8.0;
                double bure_y = Math.Sin((DDEngine.ProcFrame + cell_x + cell_y) * 0.07) * 8.0;

                DDDraw.SetAlpha(0.7);
                DDDraw.SetBright(new I3Color(0, 0, 0));
                DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, draw_x, draw_y);
                DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
                DDDraw.DrawSlide(
                    DDUtils.Random.DReal() * bure_x,
                    DDUtils.Random.DReal() * bure_y
                    );
                DDDraw.DrawEnd();
                DDDraw.Reset();
            }
        }
Exemplo n.º 28
0
        public override IEnumerable <bool> E_Draw()
        {
            for (; ;)
            {
                DDUtils.Approach(ref this.A, this.Ended ? 0.0 : 1.0, 0.91);
                DDUtils.Approach(ref this.Bright, this.Active ? 1.0 : 0.5, 0.8);
                DDUtils.Approach(ref this.X, this.Active ? this.ActivePos.X : this.UnactivePos.X, 0.85);
                DDUtils.Approach(ref this.Y, this.Active ? this.ActivePos.Y : this.UnactivePos.Y, 0.85);

                DDDraw.SetAlpha(this.A);
                DDDraw.SetBright(this.Bright, this.Bright, this.Bright);
                DDDraw.DrawBegin(this.Picture, this.X, this.Y);
                DDDraw.DrawZoom_X(this.PictureXReversed ? -1.0 : 1.0);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                yield return(!this.Ended || 0.003 < this.A);
            }
        }
Exemplo n.º 29
0
        private static void DrawTitleBack()
        {
            DDUtils.Approach(ref P_TitleBackW, P_TitleBackWDest, 0.85);

            // ---

            if (P_TitleBackW < 0.01)
            {
                return;
            }

            DDDraw.SetAlpha(TITLE_BACK_A);
            DDDraw.SetBright(0, 0, 0);
            DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);
            DDDraw.DrawSetSize_W(P_TitleBackW);
            DDDraw.DrawSetSize_H(DDConsts.Screen_H);
            DDDraw.DrawEnd();
            DDDraw.Reset();
        }
Exemplo n.º 30
0
        public void Draw()
        {
            if (this.DeadScene.IsFlaming())
            {
                DDScene scene = this.DeadScene.GetScene();

                DDDraw.SetAlpha(0.5);
                DDDraw.DrawBegin(Ground.I.Picture.Player, this.X, this.Y);
                DDDraw.DrawRotate(scene.Rate * 5.0);
                DDDraw.DrawZoom(1.0 + scene.Rate * 5.0);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                return;
            }
            if (this.BornScene.IsFlaming())
            {
                if (this.BornScene.IsJustFired())
                {
                    this.Born_X = -50.0;
                    this.Born_Y = DDConsts.Screen_H / 2.0;
                }
                DDScene scene = this.BornScene.GetScene();

                DDUtils.Approach(ref this.Born_X, this.X, 0.9 - 0.3 * scene.Rate);
                DDUtils.Approach(ref this.Born_Y, this.Y, 0.9 - 0.3 * scene.Rate);

                DDDraw.SetAlpha(0.5);
                DDDraw.DrawCenter(Ground.I.Picture.Player, this.Born_X, this.Born_Y);
                DDDraw.Reset();

                return;
            }
            if (this.MutekiScene.IsFlaming())
            {
                DDDraw.SetAlpha(0.5);
                DDDraw.DrawCenter(Ground.I.Picture.Player, this.X, this.Y);
                DDDraw.Reset();

                return;
            }
            DDDraw.DrawCenter(Ground.I.Picture.Player, this.X, this.Y);
        }