Exemplo n.º 1
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.º 2
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);
            }
        }