Exemplo n.º 1
0
        public void Test02()
        {
            DDPicture title_wall = DDPictureLoaders.Standard("title_wall.png");

            for (; ;)
            {
                DDDraw.DrawFree(
                    title_wall,
                    new D2Point(
                        Math.Cos(DDEngine.ProcFrame / 11.0) * 100 + 100,
                        Math.Sin(DDEngine.ProcFrame / 11.0) * 100 + 100
                        ),
                    new D2Point(
                        Math.Cos(DDEngine.ProcFrame / 13.0) * 100 + 700,
                        Math.Sin(DDEngine.ProcFrame / 13.0) * 100 + 100
                        ),
                    new D2Point(
                        Math.Cos(DDEngine.ProcFrame / 17.0) * 100 + 700,
                        Math.Sin(DDEngine.ProcFrame / 17.0) * 100 + 500
                        ),
                    new D2Point(
                        Math.Cos(DDEngine.ProcFrame / 19.0) * 100 + 100,
                        Math.Sin(DDEngine.ProcFrame / 19.0) * 100 + 500
                        )
                    );

                DDEngine.EachFrame();
            }
        }
Exemplo n.º 2
0
        private static void DrawDungWall(MapWall.Kind_e kind, P4Poly poly, double y)
        {
            DDPicture picture;

            switch (kind)
            {
            case MapWall.Kind_e.NONE:
                return;

            case MapWall.Kind_e.WALL:
                picture = Layout.GetWallPicture();
                break;

            case MapWall.Kind_e.WALL_BACK:
                picture = Layout.GetWallBackPicture();
                break;

            case MapWall.Kind_e.GATE:
                picture = Layout.GetGatePicture();
                break;

            default:
                throw null;                         // never
            }
            double bright = 1.0 - y / 6.0;

            DDDraw.SetBright(bright, bright, bright);
            DDDraw.DrawFree(picture, poly);
            DDDraw.Reset();
        }
Exemplo n.º 3
0
        public static void EachFrame(DDSubScreen targetScreen)
        {
            // 固定効果有り
            //if (波紋s.Count == 0)
            //    return;

            for (int x = 0; x <= PIECES_W; x++)
            {
                for (int y = 0; y <= PIECES_H; y++)
                {
                    PointTable[x, y] = new D2Point(x * PIECE_WH, y * PIECE_WH);
                }
            }

            固定効果();
            波紋s.ExecuteAllTask();

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    PieceTable[x, y].ChangeDrawScreen();

                    DX.DrawRectGraph(0, 0, x * PIECE_WH, y * PIECE_WH, (x + 1) * PIECE_WH, (y + 1) * PIECE_WH, targetScreen.GetHandle(), 0);
                }
            }

            Screen.ChangeDrawScreen();

            // フィールドの淵がめくれないように
            for (int x = 0; x <= PIECES_W; x++)
            {
                DDUtils.Minim(ref PointTable[x, 0].Y, 0.0);
                DDUtils.Maxim(ref PointTable[x, PIECES_H].Y, GameConsts.FIELD_H);
            }
            for (int y = 0; y <= PIECES_H; y++)
            {
                DDUtils.Minim(ref PointTable[0, y].X, 0.0);
                DDUtils.Maxim(ref PointTable[PIECES_W, y].X, GameConsts.FIELD_W);
            }

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    D2Point lt = PointTable[x + 0, y + 0];
                    D2Point rt = PointTable[x + 1, y + 0];
                    D2Point rb = PointTable[x + 1, y + 1];
                    D2Point lb = PointTable[x + 0, y + 1];

                    DDDraw.SetIgnoreError();
                    DDDraw.DrawFree(PieceTable[x, y].ToPicture(), lt, rt, rb, lb);
                    DDDraw.Reset();
                }
            }

            targetScreen.ChangeDrawScreen();

            DDDraw.DrawSimple(Screen.ToPicture(), 0, 0);
        }
Exemplo n.º 4
0
        public void Test04()
        {
            const int DER_WH = 60;
            const int DERS_W = 16;
            const int DERS_H = 9;

            DDPicture wallPicture = DDCCResource.GetPicture(@"dat\テスト用\IMG_20160000_000040.jpg");

            DDSubScreen screen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H);

            DDSubScreen[,] ders = new DDSubScreen[DERS_W, DERS_H];

            for (int x = 0; x < DERS_W; x++)
            {
                for (int y = 0; y < DERS_H; y++)
                {
                    ders[x, y] = new DDSubScreen(DER_WH, DER_WH);
                }
            }

            for (; ;)
            {
                DDDraw.DrawCenter(wallPicture, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);

                for (int x = 0; x < DERS_W; x++)
                {
                    for (int y = 0; y < DERS_H; y++)
                    {
                        using (ders[x, y].Section())
                            DX.DrawRectGraph(0, 0, x * DER_WH, y * DER_WH, (x + 1) * DER_WH, (y + 1) * DER_WH, DDGround.MainScreen.GetHandle(), 0);
                    }
                }

                using (screen.Section())
                {
                    for (int x = 0; x < DERS_W; x++)
                    {
                        for (int y = 0; y < DERS_H; y++)
                        {
                            DDDraw.DrawFree(
                                ders[x, y].ToPicture(),
                                new D2Point((x + 0) * DER_WH, (y + 0) * DER_WH),
                                new D2Point((x + 1) * DER_WH, (y + 0) * DER_WH),
                                new D2Point((x + 1) * DER_WH, (y + 1) * DER_WH),
                                new D2Point((x + 0) * DER_WH, (y + 1) * DER_WH)
                                );
                        }
                    }
                }

                DDDraw.DrawSimple(screen.ToPicture(), 0, 0);

                DDEngine.EachFrame();
            }
        }
Exemplo n.º 5
0
        public static void EachFrame()
        {
            if (抑止)
            {
                return;
            }

            if (波紋s.Count == 0)
            {
                return;
            }

            for (int x = 0; x <= PIECES_W; x++)
            {
                for (int y = 0; y <= PIECES_H; y++)
                {
                    PointTable[x, y] = new D2Point(x * PIECE_WH, y * PIECE_WH);
                }
            }

            波紋s.ExecuteAllTask();

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    PieceTable[x, y].ChangeDrawScreen();

                    DX.DrawRectGraph(0, 0, x * PIECE_WH, y * PIECE_WH, (x + 1) * PIECE_WH, (y + 1) * PIECE_WH, DDGround.MainScreen.GetHandle(), 0);
                }
            }

            Screen.ChangeDrawScreen();

            for (int x = 0; x < PIECES_W; x++)
            {
                for (int y = 0; y < PIECES_H; y++)
                {
                    D2Point lt = PointTable[x + 0, y + 0];
                    D2Point rt = PointTable[x + 1, y + 0];
                    D2Point rb = PointTable[x + 1, y + 1];
                    D2Point lb = PointTable[x + 0, y + 1];

                    DDDraw.SetIgnoreError();
                    DDDraw.DrawFree(PieceTable[x, y].ToPicture(), lt, rt, rb, lb);
                    DDDraw.Reset();
                }
            }

            DDGround.MainScreen.ChangeDrawScreen();

            DDDraw.DrawSimple(Screen.ToPicture(), 0, 0);
        }
Exemplo n.º 6
0
        private static void Draw円形体力ゲージ(double x, double y, double hp, double plX, double plY)
        {
            const int    DENOM = 180;
            const double R1    = 100.0;
            const double R2    = 110.0;
            const double R3    = 150.0;

            for (int numer = 0; numer < DENOM; numer++)
            {
                double rate1 = (double)(numer + 0) / DENOM;
                double rate2 = (double)(numer + 1) / DENOM;

                double ltx = x + Math.Cos((rate1 - 0.25) * Math.PI * 2.0) * R2;
                double rtx = x + Math.Cos((rate2 - 0.25) * Math.PI * 2.0) * R2;
                double rbx = x + Math.Cos((rate2 - 0.25) * Math.PI * 2.0) * R1;
                double lbx = x + Math.Cos((rate1 - 0.25) * Math.PI * 2.0) * R1;
                double lty = y + Math.Sin((rate1 - 0.25) * Math.PI * 2.0) * R2;
                double rty = y + Math.Sin((rate2 - 0.25) * Math.PI * 2.0) * R2;
                double rby = y + Math.Sin((rate2 - 0.25) * Math.PI * 2.0) * R1;
                double lby = y + Math.Sin((rate1 - 0.25) * Math.PI * 2.0) * R1;

                double  rate    = rate1;
                bool    colored = hp < rate && rate < hp * 2 || rate < hp * 2 - 1.0;
                I3Color color   = colored ? new I3Color(255, 0, 0) : new I3Color(255, 255, 255);

                bool   plNear = DDUtils.GetDistance(new D2Point(x, y), new D2Point(plX, plY)) < R3;
                double a      = plNear ? 0.25 : 0.5;

                DDDraw.SetAlpha(a);
                DDDraw.SetBright(color);
                DDDraw.DrawFree(
                    Ground.I.Picture.WhiteBox,
                    ltx, lty,
                    rtx, rty,
                    rbx, rby,
                    lbx, lby
                    );
                DDDraw.Reset();
            }
        }
Exemplo n.º 7
0
        public void Test05()
        {
            const int DER_WH = 60;
            const int DERS_W = 16;
            const int DERS_H = 9;

            DDPicture wallPicture = DDCCResource.GetPicture(@"dat\テスト用\IMG_20160000_000040.jpg");

            DDSubScreen screen = new DDSubScreen(DDConsts.Screen_W, DDConsts.Screen_H);

            DDSubScreen[,] ders = new DDSubScreen[DERS_W, DERS_H];

            for (int x = 0; x < DERS_W; x++)
            {
                for (int y = 0; y < DERS_H; y++)
                {
                    ders[x, y] = new DDSubScreen(DER_WH, DER_WH);
                }
            }

            for (; ;)
            {
                DDDraw.DrawCenter(wallPicture, DDConsts.Screen_W / 2, DDConsts.Screen_H / 2);

                for (int x = 0; x < DERS_W; x++)
                {
                    for (int y = 0; y < DERS_H; y++)
                    {
                        using (ders[x, y].Section())
                            DX.DrawRectGraph(0, 0, x * DER_WH, y * DER_WH, (x + 1) * DER_WH, (y + 1) * DER_WH, DDGround.MainScreen.GetHandle(), 0);
                    }
                }

                using (screen.Section())
                {
                    for (int x = 0; x < DERS_W; x++)
                    {
                        for (int y = 0; y < DERS_H; y++)
                        {
                            D2Point lt = new D2Point((x + 0) * DER_WH, (y + 0) * DER_WH);
                            D2Point rt = new D2Point((x + 1) * DER_WH, (y + 0) * DER_WH);
                            D2Point rb = new D2Point((x + 1) * DER_WH, (y + 1) * DER_WH);
                            D2Point lb = new D2Point((x + 0) * DER_WH, (y + 1) * DER_WH);

                            Func <D2Point, D2Point> f;

                            // -- choose one --

                            //f = Test05_波紋効果による頂点の移動;
                            f = Test05_波紋効果による頂点の移動_高速;

                            // --

                            lt = f(lt);
                            rt = f(rt);
                            rb = f(rb);
                            lb = f(lb);

                            DDDraw.DrawFree(ders[x, y].ToPicture(), lt, rt, rb, lb);
                        }
                    }
                }

                DDDraw.DrawSimple(screen.ToPicture(), 0, 0);

                DDEngine.EachFrame();
            }
        }