Exemple #1
0
 public void WriteExecute(IFxContext ctx)
 {
     if (null != mFxComet && mFxComet.IsRunning)
     {
         mPixelMap.Write(mFxComet.Execute(ctx));
     }
 }
        public override void FrameExecute()
        {
            var ctx = MakeCurrentContext();

            mMapPerimeter.Write(mFxPerimeter.Execute(ctx));
            if (TimeSpan.Zero == mWindow.CometTimeStart)
            {
                // comets reset
                mWindow.CometTimeStart = CurrentTime;
            }
            var comettime = CurrentTime - mWindow.CometTimeStart;

            if (comettime < CometTimeMax)
            {
                // comets animating
                var cctx = new FxContextSimple(comettime);
                mEdgeLeft.Write(mFxCometLeft.Execute(cctx));
                mEdgeRight.Write(mFxCometRight.Execute(cctx));
            }
        }
Exemple #3
0
        public override void FrameExecute()
        {
            var ctx = MakeCurrentContext();

            mFxPerimeterRainbow.Luminance  = PerimeterLuminanceMultiplier;
            mFxPerimeterRainbow.Saturation = Saturation.Value;
            mPixelMapPerimeter.Write(mFxPerimeterRainbow.Execute(ctx));
            mFxStarlight.Luminance = LuminanceStarlightMultiplier;
            mPixelMapStars.Write(mFxStarlight.Execute(ctx));

            mGlimRedGun.WriteExecute(ctx);
            mGlimBlueGun.WriteExecute(ctx);
            if (null != mFxBarrel && mFxBarrel.IsRunning)
            {
                mPixelMapBarrel.Write(mFxBarrel.Execute(ctx));
            }
            switch (mGameState)
            {
            case GameState.Null:
            case GameState.SynchronizedShotsFired:
                return;
            }
            double lumscale = 0.0;

            if (GameState.CoolDown == mGameState)
            {
                mPixelMapBarrel.Write(BarrelColour());
                mPixelMapStars.Write(mFxCannonTwinkle.Execute(ctx));
                // take 2 seconds to return to full glow
                lumscale = ((CurrentTime - mGameCoolDownStart).TotalSeconds - 1) / 2;
            }
            if (lumscale < 1)
            {
                // barrel shot or cooling down
            }
            else
            {
                mGameState = GameState.Null;
                RecalculateButtonGlimmer(mGlimBlueGun);
                RecalculateButtonGlimmer(mGlimRedGun);
            }
            switch (mGameState)
            {
            case GameState.BarrelShotFired:
                if (!mFxBarrel.IsRunning)
                {
                    mGameState         = GameState.CoolDown;
                    mGameCoolDownStart = CurrentTime;
                    mFxBarrel          = null;
                }
                break;

            case GameState.SynchronizedShotsFired:
                if (!mGlimBlueGun.CometIsRunning || !mGlimRedGun.CometIsRunning)
                {
                    mGameState = GameState.BarrelShotFired;
                    mFxBarrel  = new FxComet {
                        BaseColor = Color.FromArgb(0xff, 0, 0xff), PixelCount = 50
                    };
                }
                break;
            }
        }