Exemplo n.º 1
0
        protected override IEnumerable <bool> E_Draw()
        {
            const double CHARA_R = 8.0;

            for (; ;)
            {
                this.X += this.XAdd;
                this.Y += this.YAdd;

                // 壁衝突判定
                //if (Game.I.Map.GetCell(GameCommon.ToTablePoint(new D2Point(this.X, this.Y))).Tile.IsWall())
                //    break;

                if (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), CHARA_R * 1.2))
                {
                    // 暫定_描画
                    {
                        DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                        DDDraw.DrawSetSize(CHARA_R * 2, CHARA_R * 2);
                        DDDraw.DrawEnd();

                        DDPrint.SetDebug((int)this.X - DDGround.ICamera.X, (int)this.Y - DDGround.ICamera.Y);
                        DDPrint.SetBorder(new I3Color(0, 0, 0));
                        DDPrint.Print("[敵弾]");
                        DDPrint.Reset();
                    }

                    this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), CHARA_R);
                }
                yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y)));
            }
        }
Exemplo n.º 2
0
        public override void Draw()
        {
            if (Game.I.FreezeEnemy)
            {
                goto startDraw;
            }

            this.IRot += this.IRotSpeed;

            this.IRot += IROT_360;
            this.IRot %= IROT_360;

startDraw:
            double rot = this.IRot * (Math.PI * 2.0) / IROT_360;

            double x = this.X + Math.Cos(rot) * R;
            double y = this.Y + Math.Sin(rot) * R;

            if (!EnemyCommon.IsOutOfScreen_ForDraw(new D2Point(x - DDGround.Camera.X, y - DDGround.Camera.Y)))
            {
                //DDDraw.SetBright(new I3Color(32, 192, 32)); // old
                DDDraw.SetBright(Game.I.Map.Design.EnemyColor_Cookie);
                DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, SCommon.ToInt(x - DDGround.ICamera.X), SCommon.ToInt(y - DDGround.ICamera.Y));
                DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
                DDDraw.DrawEnd();
                DDDraw.Reset();

                this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(x, y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H));

                Game.I.タイル接近_敵描画_Points.Add(new D2Point(x, y));
            }
        }
Exemplo n.º 3
0
 public override IEnumerable <bool> E_Task()
 {
     for (; ;)
     {
         if (_lastTopMenuLeaved != TitleMenu.I.DrawWall.TopMenuLeaved)
         {
             if (TitleMenu.I.DrawWall.TopMenuLeaved)
             {
                 foreach (bool v in this.E_Move(_x1, _y1, _x2, _y2, _rot, 0.0))
                 {
                     yield return(v);
                 }
             }
             else
             {
                 foreach (bool v in this.E_Move(_x2, _y2, _x1, _y1, 0.0, _rot))
                 {
                     yield return(v);
                 }
             }
             _lastTopMenuLeaved = TitleMenu.I.DrawWall.TopMenuLeaved;
         }
         if (TitleMenu.I.DrawWall.TopMenuLeaved)
         {
             DDDraw.SetBright(_color);
             DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, _x2, _y2);
             DDDraw.DrawSetSize(TILE_W, TILE_H);
             DDDraw.DrawEnd();
             DDDraw.Reset();
         }
         yield return(true);
     }
 }
Exemplo n.º 4
0
        private void DrawOnDead(double rate)
        {
            DDDraw.SetAlpha(0.3);

            for (int c = 0; c < 5; c++)
            {
                DDDraw.DrawBegin(Ground.I.Picture.WhiteBox, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);

                double hir = 1.0 + DDUtils.Random.Real() * rate * 3.0;
                double lwr = 1.0 / hir;

                hir *= hir;
                hir *= hir;

                if (DDUtils.Random.Real() < 0.5)
                {
                    DDDraw.DrawZoom_X(hir);
                    DDDraw.DrawZoom_Y(lwr);
                }
                else
                {
                    DDDraw.DrawZoom_X(lwr);
                    DDDraw.DrawZoom_Y(hir);
                }

                DDDraw.DrawSlide(
                    (DDUtils.Random.Real() - 0.5) * 2.0 * 40.0 * rate,
                    (DDUtils.Random.Real() - 0.5) * 2.0 * 40.0 * rate
                    );
                DDDraw.DrawEnd();
            }
            DDDraw.Reset();
        }
Exemplo n.º 5
0
 public void Draw()
 {
     DDDraw.SetBright(1.0, 0.5, 0.0);
     DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
     DDDraw.DrawSetSize(100.0, 100.0);
     DDDraw.DrawEnd();
     DDDraw.Reset();
 }
Exemplo n.º 6
0
        protected override IEnumerable <bool> E_Draw()
        {
            while (!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y)))
            {
                this.X += 12.0 * (this.FacingLeft ? -1 : 1);

                switch (this.Level)
                {
                case 1:
                {
                    DDDraw.DrawCenter(Ground.I.Picture.Shot_Normal, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);

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

                case 2:
                {
                    const double R = 14.0;

                    DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                    DDDraw.DrawSetSize(R, R);
                    DDDraw.DrawEnd();

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

                case 3:
                {
                    const double R = 24.0;

                    DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                    DDDraw.DrawSetSize(R, R);
                    DDDraw.DrawEnd();

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

                case 4:
                {
                    const double R = 48.0;

                    DDDraw.DrawBegin(Ground.I.Picture.WhiteCircle, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                    DDDraw.DrawSetSize(R, R);
                    DDDraw.DrawEnd();

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

                default:
                    throw null;                             // never
                }
                yield return(true);
            }
        }
Exemplo n.º 7
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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 9
0
        //
        //	copied the source file by https://github.com/stackprobe/Factory/blob/master/SubTools/CopyLib.c
        //
        public void Draw(IEnumerable <Crash> crashes, I3Color color)
        {
            DDDraw.SetBright(color);

            using (this.MyScreen.Section())
            {
                Queue <IEnumerable <Crash> > q = new Queue <IEnumerable <Crash> >();

                q.Enqueue(crashes);

                while (1 <= q.Count)
                {
                    foreach (Crash crash in q.Dequeue())
                    {
                        switch (crash.Kind)
                        {
                        case CrashUtils.Kind_e.NONE:
                            break;

                        case CrashUtils.Kind_e.POINT:
                            DDDraw.DrawBegin(DDGround.GeneralResource.WhiteBox, crash.Pt.X - DDGround.ICamera.X, crash.Pt.Y - DDGround.ICamera.Y);
                            DDDraw.DrawSetSize(POINT_WH, POINT_WH);
                            DDDraw.DrawEnd();
                            break;

                        case CrashUtils.Kind_e.CIRCLE:
                            DDDraw.DrawBegin(DDGround.GeneralResource.WhiteCircle, crash.Pt.X - DDGround.ICamera.X, crash.Pt.Y - DDGround.ICamera.Y);
                            DDDraw.DrawSetSize(crash.R * 2.0, crash.R * 2.0);
                            DDDraw.DrawEnd();
                            break;

                        case CrashUtils.Kind_e.RECT:
                            DDDraw.DrawRect(
                                DDGround.GeneralResource.WhiteBox,
                                crash.Rect.L - DDGround.ICamera.X,
                                crash.Rect.T - DDGround.ICamera.Y,
                                crash.Rect.W,
                                crash.Rect.H
                                );
                            break;

                        case CrashUtils.Kind_e.MULTI:
                            q.Enqueue(crash.Cs);
                            break;

                        default:
                            throw null;                                     // never
                        }
                    }
                }
            }
            DDDraw.Reset();
        }
Exemplo n.º 10
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.º 11
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.º 12
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.º 13
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.º 14
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.º 15
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.º 16
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.º 17
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.º 18
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.º 19
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.º 20
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.º 21
0
        public override void Draw()
        {
            if (!EnemyCommon.IsOutOfScreen_ForDraw(this))
            {
                double p = Math.Sin(DDEngine.ProcFrame / 10.0 + this.X + this.Y) * 0.5 + 0.5;                 // color phaese

                DDDraw.SetBright(new I3Color(
                                     SCommon.ToInt(DDUtils.AToBRate(Game.I.Map.Design.EnemyColor_Death_A.R, Game.I.Map.Design.EnemyColor_Death_B.R, p)),
                                     SCommon.ToInt(DDUtils.AToBRate(Game.I.Map.Design.EnemyColor_Death_A.G, Game.I.Map.Design.EnemyColor_Death_B.G, p)),
                                     SCommon.ToInt(DDUtils.AToBRate(Game.I.Map.Design.EnemyColor_Death_A.B, Game.I.Map.Design.EnemyColor_Death_B.B, p))
                                     ));
                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();
                DDDraw.Reset();

                this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H));

                //Game.I.タイル接近_敵描画_Points.Add(new D2Point(this.X, this.Y)); // 地形の一部なので、追加しない。
            }
        }
Exemplo n.º 22
0
        public override void Draw()
        {
            if (Game.I.Player.DeadFrame != 0)             // ? プレイヤー死亡
            {
                DDUtils.Approach(ref this.Speed, 4.0, 0.9);
            }
            else
            {
                DDUtils.Approach(ref this.Speed, 9.0, 0.975);
            }

            D2Point currSpeed = DDUtils.AngleToPoint(this.Angle, this.Speed);

            this.X += currSpeed.X;
            this.Y += currSpeed.Y;

            DDDraw.SetBright(this.Color);
            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.DrawRotate(this.Rot);
            DDDraw.DrawEnd();
            DDDraw.Reset();

            this.RotAdd += this.RotAddAdd;
            this.Rot    += this.RotAdd;

            //this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H)); // old
            this.Crash = DDCrashUtils.Circle(new D2Point(this.X, this.Y), GameConsts.TILE_W / 2.0);

            Game.I.タイル接近_敵描画_Points.Add(new D2Point(this.X, this.Y));

            if (
                Game.I.Player.DeadFrame == 0 &&                 // ? プレイヤー生存
                DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), 50.0)
                )
            {
                this.DeadFlag = true;
            }
        }
Exemplo n.º 23
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));                // カメラから出たら消滅する。
            }
        }
Exemplo n.º 24
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));                // カメラから出たら消滅する。
            }
        }
Exemplo n.º 25
0
        public override void DrawPlayer()
        {
            double map_b = Game.I.Map.H * GameConsts.TILE_H;
            double pl_y  = Game.I.Player.Y;

            double y = (map_b - 70) - pl_y;

            y /= 300.0;
            y  = Math.Abs(y);

            if (y < 1.0)
            {
                DDDraw.SetAlpha(y);
            }
            DDDraw.DrawBegin(
                Ground.I.Picture.WhiteBox,
                SCommon.ToInt(Game.I.Player.X - DDGround.ICamera.X),
                SCommon.ToInt(Game.I.Player.Y - DDGround.ICamera.Y)
                );
            DDDraw.DrawSetSize(GameConsts.TILE_W, GameConsts.TILE_H);
            DDDraw.DrawEnd();
            DDDraw.Reset();
        }
Exemplo n.º 26
0
        public override void Draw()
        {
            this.X += this.XSpeed;
            this.Y += this.YSpeed;

            if (this.Y < this.Highest_Y)
            {
                DDUtils.Approach(ref this.YSpeed, 重力加速度, 0.9);
            }
            this.YSpeed = Math.Min(落下最高速度, this.YSpeed);

            int ix = SCommon.ToInt(this.X);
            int iy = SCommon.ToInt(this.Y);

            Around a2 = new Around(ix, iy, 2);

            int xDirSign = 0;
            int yDirSign = 0;

            if (this.Y < this.Highest_Y + 24.0)             // ? 最高高度に近い
            {
                if (
                    a2.Table[0, 0].IsEnemyPataWall() ||
                    a2.Table[0, 1].IsEnemyPataWall()
                    )
                {
                    xDirSign++;
                }

                if (
                    a2.Table[1, 0].IsEnemyPataWall() ||
                    a2.Table[1, 1].IsEnemyPataWall()
                    )
                {
                    xDirSign--;
                }
            }
            else
            {
                if (
                    a2.Table[0, 0].IsEnemyPataWall() &&
                    a2.Table[0, 1].IsEnemyPataWall()
                    )
                {
                    xDirSign++;
                }

                if (
                    a2.Table[1, 0].IsEnemyPataWall() &&
                    a2.Table[1, 1].IsEnemyPataWall()
                    )
                {
                    xDirSign--;
                }
            }

            if (
                !a2.Table[0, 0].IsEnemyPataWall() && a2.Table[0, 1].IsEnemyPataWall() ||
                !a2.Table[1, 0].IsEnemyPataWall() && a2.Table[1, 1].IsEnemyPataWall()
                )
            {
                yDirSign = -1;
            }
            else if (
                a2.Table[0, 0].IsEnemyPataWall() &&
                a2.Table[1, 0].IsEnemyPataWall()
                )
            {
                yDirSign = 1;
            }
            else
            {
                this.YSpeed += 重力加速度;
            }

            if (xDirSign != 0)
            {
                this.XSpeed = Math.Abs(this.XSpeed) * xDirSign;
            }

            if (yDirSign != 0)
            {
                this.YSpeed = Math.Abs(this.YSpeed) * yDirSign;
            }

            if (!EnemyCommon.IsOutOfScreen_ForDraw(this))
            {
                //DDDraw.SetBright(new I3Color(192, 32, 32)); // old
                DDDraw.SetBright(Game.I.Map.Design.EnemyColor_Pata);
                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();
                DDDraw.Reset();

                this.Crash = DDCrashUtils.Rect_CenterSize(new D2Point(this.X, this.Y), new D2Size(GameConsts.TILE_W, GameConsts.TILE_H));

                Game.I.タイル接近_敵描画_Points.Add(new D2Point(this.X, this.Y));
            }
        }
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 || cell.IsCookie())
            {
                // cell.敵接近_Rate 更新
                {
                    double rate = GetEnemyNearlyRate(
                        DDGround.Camera.X + draw_x,
                        DDGround.Camera.Y + draw_y
                        );

                    DDUtils.Maxim(ref cell.敵接近_Rate, rate);

                    cell.敵接近_Rate *= 0.97;
                }

                double p = cell.ColorPhase;

                if (this.市松tic)
                {
                    if ((cell_x + cell_y) % 2 == 0)
                    {
                        p = p * 0.7;
                    }
                    else
                    {
                        p = p * 0.3 + 0.7;
                    }
                }

                //DDDraw.SetAlpha(0.9 - cell.敵接近_Rate * 0.6); // old
                DDDraw.SetAlpha(this.WallAlpha * (1.0 - cell.敵接近_Rate * 0.5));
                DDDraw.SetBright(new I3Color(
                                     SCommon.ToInt(DDUtils.AToBRate(this.Color_A.R, this.Color_B.R, p)),
                                     SCommon.ToInt(DDUtils.AToBRate(this.Color_A.G, this.Color_B.G, p)),
                                     SCommon.ToInt(DDUtils.AToBRate(this.Color_A.B, this.Color_B.B, p))
                                     ));
                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(this.CookieAxisColor);
                    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 / 37.0) * 0.3 +
                //    Math.Sin(DDEngine.ProcFrame / 0.7) * 0.1 +
                //    0.6;
                double bright = Math.Sin(DDEngine.ProcFrame / 13.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.º 28
0
        protected override IEnumerable <bool> E_Draw()
        {
            double       R           = LevelToR(this.Level);       // 自弾半径
            const double X_ADD       = 8.0;                        // 横移動速度
            const double GRAVITY     = 0.8;                        // 重力加速度
            const double Y_ADD_MAX   = 19.0;                       // 落下最高速度
            double       Y_ADD_FIRST = Game.I.Player.YSpeed - 6.0; // 初期_縦移動速度
            const double K           = 0.98;                       // 跳ね返り係数

            double yAdd         = Y_ADD_FIRST;
            int    bouncedCount = 0;

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

            for (int frame = 0; ; frame++)
            {
                this.X += X_ADD * (this.FacingLeft ? -1 : 1);
                this.Y += yAdd;

                yAdd += GRAVITY;

                DDUtils.Minim(ref yAdd, Y_ADD_MAX);

                // 跳ね返り
                {
                    int xBounce = 0;
                    int yBounce = 0;

                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X - R, this.Y)).Tile.IsWall())
                    {
                        xBounce += 3;
                    }
                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X + R, this.Y)).Tile.IsWall())
                    {
                        xBounce -= 3;
                    }
                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X, this.Y - R)).Tile.IsWall())
                    {
                        yBounce += 3;
                    }
                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X, this.Y + R)).Tile.IsWall())
                    {
                        yBounce -= 3;
                    }
                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X - R / Consts.ROOT_OF_2, this.Y - R / Consts.ROOT_OF_2)).Tile.IsWall())
                    {
                        xBounce += 2;
                        yBounce += 2;
                    }
                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X + R / Consts.ROOT_OF_2, this.Y - R / Consts.ROOT_OF_2)).Tile.IsWall())
                    {
                        xBounce -= 2;
                        yBounce += 2;
                    }
                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X - R / Consts.ROOT_OF_2, this.Y + R / Consts.ROOT_OF_2)).Tile.IsWall())
                    {
                        xBounce += 2;
                        yBounce -= 2;
                    }
                    if (Game.I.Map.GetCell(GameCommon.ToTablePoint(this.X + R / Consts.ROOT_OF_2, this.Y + R / Consts.ROOT_OF_2)).Tile.IsWall())
                    {
                        xBounce -= 2;
                        yBounce -= 2;
                    }

                    DDUtils.ToRange(ref xBounce, -1, 1);
                    DDUtils.ToRange(ref yBounce, -1, 1);

                    bool bounced = xBounce != 0 || yBounce != 0;

                    if (bounced)
                    {
                        bouncedCount++;

                        if (20 <= bouncedCount)                         // ? 跳ね返り回数オーバー
                        {
                            //DDGround.EL.Add(SCommon.Supplier(Effects.FireBall爆発(this.X, this.Y)));
                            break;
                        }
                    }

                    if (xBounce == -1)
                    {
                        this.FacingLeft = true;
                    }
                    else if (xBounce == 1)
                    {
                        this.FacingLeft = false;
                    }

                    if (yBounce == -1)
                    {
                        if (0.0 < yAdd)
                        {
                            yAdd *= -K;
                        }
                    }
                    else if (yBounce == 1)
                    {
                        if (yAdd < 0.0)
                        {
                            yAdd *= -K;
                        }
                    }
                }

                DDDraw.DrawBegin(Ground.I.Picture2.陰陽玉, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawSetSize(R * 2, R * 2);
                DDDraw.DrawRotate(frame / 10.0);
                DDDraw.DrawEnd();

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

                yield return(!DDUtils.IsOutOfCamera(new D2Point(this.X, this.Y), R));                // カメラから出たら消滅する。
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// レイヤ表示を実行する。
        /// ステージ番号:
        /// -- 1~9 == 各ステージ
        /// </summary>
        /// <param name="stageNo">ステージ番号</param>
        /// <param name="themeColor">このステージの印象的な色</param>
        public static void Perform(int stageNo, I3Color themeColor)
        {
            int layerNo = 10 - stageNo;

            DDCurtain.SetCurtain(0, -1.0);
            DDCurtain.SetCurtain();

            using (DDSubScreen tmpScreen = new DDSubScreen(400, 200))
            {
                foreach (DDScene scene in DDSceneUtils.Create(210))
                {
                    if (scene.Numer + 30 == scene.Denom)
                    {
                        DDCurtain.SetCurtain(30, -1.0);
                    }

                    DDCurtain.DrawCurtain();

                    int bure  = (int)(scene.Rate * scene.Rate * 20);
                    int xBure = DDUtils.Random.GetRange(-bure, bure);
                    int yBure = DDUtils.Random.GetRange(-bure, bure);
#if true
                    DDFontUtils.DrawString_XCenter(
                        DDConsts.Screen_W / 2 + xBure,
                        DDConsts.Screen_H / 2 + yBure - 50,
                        "LAYER " + layerNo,
                        DDFontUtils.GetFont("03焚火-Regular", 100)
                        );
#else
                    using (tmpScreen.Section())
                    {
                        DDPrint.SetColor(new I3Color(60, 60, 60));
                        DDPrint.SetBorder(new I3Color(255, 255, 255));
                        DDPrint.SetPrint(tmpScreen.GetSize().W / 2 - 60, tmpScreen.GetSize().H / 2 - 8);
                        DDPrint.Print("L A Y E R : " + layerNo);
                        DDPrint.Reset();
                    }
                    DDDraw.SetMosaic();
                    DDDraw.DrawBegin(
                        tmpScreen.ToPicture(),
                        DDConsts.Screen_W / 2 + xBure,
                        DDConsts.Screen_H / 2 + yBure
                        );
                    DDDraw.DrawZoom(6.0);
                    DDDraw.DrawEnd();
                    DDDraw.Reset();
#endif

                    if (0.5 < scene.Rate)
                    {
                        const int c_max = 300;

                        for (int c = (int)(scene.Rate * scene.Rate * c_max); 0 < c; c--)
                        {
                            double c_rate = (double)c / c_max;

                            DDDraw.SetAlpha(scene.Rate * 0.5);
                            //DDDraw.SetBright(new I3Color(c, c, c)); // old
                            DDDraw.SetBright(new I3Color(
                                                 (int)(themeColor.R * c_rate),
                                                 (int)(themeColor.G * c_rate),
                                                 (int)(themeColor.B * c_rate)
                                                 ));
                            DDDraw.DrawBegin(
                                Ground.I.Picture.WhiteBox,
                                DDUtils.Random.GetInt(DDConsts.Screen_W),
                                DDUtils.Random.GetInt(DDConsts.Screen_H)
                                );
                            DDDraw.DrawSetSize(
                                DDUtils.Random.GetRange(40, (int)(400 * scene.Rate)),
                                DDUtils.Random.GetRange(20, (int)(200 * scene.Rate))
                                );
                            DDDraw.DrawEnd();
                            DDDraw.Reset();
                        }
                    }

                    DDEngine.EachFrame();
                }
            }

            DDCurtain.SetCurtain(0);
        }
Exemplo n.º 30
0
        protected override IEnumerable <bool> E_Draw()
        {
            double SCALE = LevelToScale(this.Level);
            double R     = SCommon.ToInt(24.0 * SCALE);

            double xAdd = this.FacingLeft ? -1.0 : 1.0;
            double yAdd = Game.I.Player.YSpeed * 0.2;

            DDUtils.MakeXYSpeed(0.0, 0.0, xAdd, yAdd, 20.0 * SCALE, out xAdd, out yAdd);

            for (int frame = 0; ; frame++)
            {
                if (Game.I.Status.Equipment != GameStatus.Equipment_e.ハンマー陰陽玉)                 // 武器を切り替えたら消滅
                {
                    this.Kill();
                    break;
                }
                double xaa;
                double yaa;

                // バネの加速度
                {
                    xaa = (Game.I.Player.X - this.X) * 0.01;
                    yaa = (Game.I.Player.Y - this.Y) * 0.01;
                }

                yaa += 1.0;                 // 重力加速度

                xAdd += xaa;
                yAdd += yaa;

                // 空気抵抗
                {
                    double 空気抵抗 = LevelTo空気抵抗(this.Level);

                    xAdd *= 空気抵抗;
                    yAdd *= 空気抵抗;
                }

                this.X += xAdd;
                this.Y += yAdd;

                DDDraw.DrawBegin(Ground.I.Picture2.陰陽玉, this.X - DDGround.ICamera.X, this.Y - DDGround.ICamera.Y);
                DDDraw.DrawSetSize(R * 2, R * 2);
                DDDraw.DrawRotate(frame / 10.0);
                DDDraw.DrawEnd();

                // プレイヤーとハンマーを繋ぐバネのような何かを描画する。
                {
                    double d = DDUtils.GetDistance(this.X - Game.I.Player.X, this.Y - Game.I.Player.Y);

                    if (10.0 < d)
                    {
                        double x   = (this.X + Game.I.Player.X) / 2.0;
                        double y   = (this.Y + Game.I.Player.Y) / 2.0;
                        double rot = DDUtils.GetAngle(this.X - Game.I.Player.X, this.Y - Game.I.Player.Y) + Math.PI / 2;

                        DDDraw.SetAlpha(0.5);
                        DDDraw.DrawBegin(Ground.I.Picture2.Laser[4], x - DDGround.ICamera.X, y - DDGround.ICamera.Y);
                        DDDraw.DrawSetSize_H(d);
                        DDDraw.DrawRotate(rot);
                        DDDraw.DrawEnd();
                        DDDraw.Reset();
                    }
                }

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

                yield return(true);
            }
        }