예제 #1
0
        public override void Update(GameTime dt)
        {
            if (!ChicksnVixensGame.Get.IsLocationUnlocked(worldLocations[curLocation]))
            {
                Vector4 col = locked.Colour.ToVector4();
                col.W         = JabMath.LinearMoveTowards(col.W, 1.0f, gttf(dt));
                locked.Colour = new Color(col.W, col.W, col.W, col.W);
            }
            else
            {
                Vector4 col = locked.Colour.ToVector4();
                col.W         = JabMath.LinearMoveTowards(col.W, 0.0f, gttf(dt));
                locked.Colour = new Color(col.W, col.W, col.W, col.W);
            }
            if (blank != null)
            {
                if (blank.StateFlag == Jabber.StateFlag.FADE_IN_COMPLETE)
                {
                    OnFadeOutComplete();
                }
            }
            if (IsTopScreen || ScreenManager.Get.TopScreen.CheckFlag(Flags.FADE_OUT))
            {
                /*
                 * if (Cam.TargetPos == Cam.Position)
                 * {
                 *  Cam.targetScale = 1.8f;
                 * }*/
                Cam.LevelSelect = false;
            }
            else if (!IsTopScreen)
            {
                Cam.LevelSelect = true;
                Cam.targetScale = 1.2f;
            }
            if (loadLocation)
            {
                LevelSelectScreen screen = new LevelSelectScreen(worldLocations[curLocation]);//  currentLocation.location);
                screen.Initialize(Content);
                ScreenManager.Get.AddScreen(screen);
                Cam.targetScale = 1.2f;
                Cam.LevelSelect = true;
                EventManager.Get.SendEvent(new ScreenFadeOutEvent(this));
                loadLocation = false;
                if (playLocationSetSFX)
                {
                    AudioManager.PlayOnce("Sounds/CountrySelect");
                }

                playLocationSetSFX = true;
            }
#if WINDOWS_PHONE
            AdSystem.TargetTop = false;
#endif
            base.Update(dt);
        }
예제 #2
0
        public override void Update(GameTime dt)
        {
            if (firstUpdate)
            {
                AudioManager.StopTheMusic();
                AudioManager.PlayMusic("francemusic");
                firstUpdate = false;
            }

            base.Update(dt);

            if (AudioManager.PlayingMusicPosition > 11.7)
            {
                longstrip.PosX = -Jabber.BaseGame.Get.BackBufferWidth / 2.0f;
                timer1         = 1;
                timer2         = 1;
            }

            if (timer1 < 1)
            {
                timer1 += gttf(dt) / 3.0f;
            }
            else if (timer2 < 1)
            {
                longstrip.PosX = JabMath.LinearMoveTowards(longstrip.PosX, -Jabber.BaseGame.Get.BackBufferWidth / 2.0f, gttf(dt) * 150 * ScaleFactor);

                if (longstrip.PosX == -Jabber.BaseGame.Get.BackBufferWidth / 2.0f)
                {
                    timer2 += gttf(dt) / 3.0f;
                }
            }
            else
            {
                timer3 += gttf(dt);
                if (timer3 > 4.0f)
                {
                    Vector4 col = finalimage.Colour.ToVector4();
                    float   a   = JabMath.LinearMoveTowards(col.W, 0.0f, gttf(dt));
                    finalimage.Colour = new Color(a, a, a, a);

                    if (a == 0)
                    {
                        RaiseFlag(Flags.DELETE);
                        WorldSelectScreen s = new WorldSelectScreen();
                        s.Initialize(BaseGame.Get.Content);
                        s.SetCurrentCountry("paris");
                        ScreenManager.Get.AddScreen(s);
                    }
                }
            }
        }
예제 #3
0
파일: Donut.cs 프로젝트: meds/ChicksnVixens
        public override void Update(GameTime dt)
        {
            base.Update(dt);

            if (score == null)
            {
                for (int i = 0; i < scene.Nodes.Count; i++)
                {
                    if (scene.Nodes[i] is DonutScore)
                    {
                        score = scene.Nodes[i] as DonutScore;
                    }
                }
            }

            box.Position = Position;

            if (!Chosen)
            {
                if (InFan)
                {
                    Timer += gttf(dt) * 2.0f;
                    PosY  += JabMath.Sin(Timer) * WindWeakness;

                    if (Timer > 2 * JabMath.PI)
                    {
                        ;
                    }
                    Timer -= 2 * JabMath.PI;
                }
                else
                {
                    Timer += gttf(dt) * 4.0f;
                    PosY  += JabMath.Sin(Timer) * 0.25f;
                }
            }
            else
            {
                Position = JabMath.LinearMoveTowards(Position, score.ScaledPos, gttf(dt) * 1000.0f / Camera.Get.UniformWorldScale);

                UniformScale = JabMath.LinearMoveTowards(UniformScale, score.ScaledScale, gttf(dt) / Camera.Get.UniformWorldScale);

                if (Position == score.ScaledPos && !CheckFlag(Flags.DELETE))
                {
                    RaiseFlag(Flags.DELETE);
                    score.IncrementScore();
                }
            }

            InFan = false;
        }
예제 #4
0
        public override void Update(GameTime dt)
        {
            base.Update(dt);

            if (!(CheckFlag(Flags.FADE_IN) || CheckFlag(Flags.FADE_OUT)) && CheckStateFlag(StateFlag.FADE_IN_COMPLETE))
            {
                if (IsPressing)
                {
                    UniformScale = JabMath.LinearMoveTowards(UniformScale, 0.8f * ScaleFactor / Camera.Get.UniformWorldScale * 1.15f, gttf(dt) * 0.8f);
                }
                else
                {
                    float target = 0.8f * ScaleFactor / Camera.Get.UniformWorldScale;
                    UniformScale = JabMath.LinearMoveTowards(UniformScale, target, gttf(dt));
                }
            }
            else
            {
                UniformScale = 0.8f * ScaleFactor / Camera.Get.UniformWorldScale;
            }

            if (!(CheckFlag(Flags.FADE_IN) || CheckFlag(Flags.FADE_OUT)) && CheckStateFlag(StateFlag.FADE_IN_COMPLETE))
            {
                text.UniformScale = ScaleFactor / Camera.Get.UniformWorldScale * UniformScale * 1.2f;
            }
            else
            {
                text.UniformScale = ScaleFactor / Camera.Get.UniformWorldScale;
            }

            float alpha = JabMath.LinearInterpolate(1.0f, 0.0f, (Camera.Get.UniformWorldScale - 1) / 2.0f);

            if (lastAlpha != alpha)
            {
                if (alpha == 0)
                {
                    OnFadeOutComplete();
                }
                else if (alpha == 1)
                {
                    OnFadeInComplete();
                }
            }

            lastAlpha   = alpha;
            Colour      = new Color(alpha, alpha, alpha, alpha);
            text.Colour = Color.Red * alpha;
        }
예제 #5
0
        public override void Update(GameTime dt)
        {
            base.Update(dt);

            score.Position      = ScaledPos + new Vector2(Width / 1.5f * ScaledScale, 0);
            score.UniformScale  = ScaledScale * 1.25f + scoreWooTimer / Camera.Get.UniformWorldScale;
            score.UniformScale *= 0.5f;
            score.Colour        = Color.Tomato;

            UniformScale  = (scoreWooTimer / Camera.Get.UniformWorldScale) * 0.2f + 1;
            UniformScale *= ScaleFactor;
            UniformScale *= 0.5f;


            if (scoreWooTimer > 0)
            {
                scoreWooTimer = JabMath.LinearMoveTowards(scoreWooTimer, 0.0f, gttf(dt));
            }
        }
예제 #6
0
        public override void Update(GameTime dt)
        {
            base.Update(dt);

            if (timer1 < 1)
            {
                timer1 += gttf(dt) / 3.0f;
            }
            else if (timer2 < 1)
            {
                longstrip.PosX = JabMath.LinearMoveTowards(longstrip.PosX, -Jabber.BaseGame.Get.BackBufferWidth / 2.0f, gttf(dt) * 150 * ScaleFactor);

                if (longstrip.PosX == -Jabber.BaseGame.Get.BackBufferWidth / 2.0f)
                {
                    timer2 += gttf(dt) / 3.0f;
                }
            }
            else
            {
                // timer3 += gttf(dt);
                // if (timer3 > 4.0f)
                {
                    // Vector4 col = finalimage.Colour.ToVector4();
                    // float a = JabMath.LinearMoveTowards(col.W, 0.0f, gttf(dt));
                    // finalimage.Colour = new Color(a, a, a, a);

                    //if (a == 0)
                    {
                        RaiseFlag(Flags.DELETE);
                        WorldSelectScreen s = new WorldSelectScreen();
                        s.Initialize(BaseGame.Get.Content);
                        s.SetCurrentCountry("bavaria");
                        ScreenManager.Get.AddScreen(s);
                    }
                }
            }
        }
예제 #7
0
        public override void Update(GameTime dt)
        {
            base.Update(dt);

            if (timer1 < 1)
            {
                timer1 += gttf(dt) / 3.0f;
            }
            else if (timer2 < 1)
            {
                longstrip.PosX = JabMath.LinearMoveTowards(longstrip.PosX, -Jabber.BaseGame.Get.BackBufferWidth / 2.0f, gttf(dt) * 150 * ScaleFactor);

                if (longstrip.PosX == -Jabber.BaseGame.Get.BackBufferWidth / 2.0f)
                {
                    timer2 += gttf(dt) / 4.0f;
                }
            }
            else
            {
                finalimage.PosX = JabMath.LinearMoveTowards(finalimage.PosX, -Jabber.BaseGame.Get.BackBufferWidth / 2.0f, gttf(dt) * 150 * ScaleFactor);

                if (finalimage.PosX == -Jabber.BaseGame.Get.BackBufferWidth / 2.0f)
                {
                    timer3 += gttf(dt) / 4.0f;
                }
                if (timer3 > 1.0f)
                {
                    RaiseFlag(Flags.DELETE);


                    WorldSelectScreen s = new WorldSelectScreen();
                    s.Initialize(BaseGame.Get.Content);
                    s.SetCurrentCountry("polar");
                    ScreenManager.Get.AddScreen(s);
                }
            }
        }
예제 #8
0
        public override void Update(GameTime dt)
        {
            base.Update(dt);

            if (MediaPlayer.PlayPosition.TotalSeconds > 6)
            {
                timer1 = 1;
            }
            if (MediaPlayer.PlayPosition.TotalSeconds > 11)
            {
                RaiseFlag(Flags.DELETE);

                WorldSelectScreen s = new WorldSelectScreen();
                s.Initialize(BaseGame.Get.Content);
                s.SetCurrentCountry("vesuvius");
                ScreenManager.Get.AddScreen(s);

                return;
            }
            if (timer1 < 1 || !AudioManager.MusicPlaying)
            {
                timer1 += gttf(dt) / 3.0f;
            }
            else if (timer2 < 1)
            {
                longstrip.PosX = JabMath.LinearMoveTowards(longstrip.PosX, -Jabber.BaseGame.Get.BackBufferWidth / 2.0f, gttf(dt) * 200 * ScaleFactor);

                if (Math.Abs(longstrip.PosX - -Jabber.BaseGame.Get.BackBufferWidth / 2.0f) < 400 * ScaleFactor)
                {
                    float f = longstrip.Colour.ToVector4().W;
                    f = JabMath.MoveTowards(f, 0, gttf(dt) * 1.3f);
                    longstrip.Colour = Color.White * f;
                    if (f == 0)
                    {
                        timer2 = 1.0f;
                    }
                }

                if (longstrip.PosX == -Jabber.BaseGame.Get.BackBufferWidth / 2.0f)
                {
                    timer2 += gttf(dt) / 4.0f;
                }
            }
            if (Math.Abs(longstrip.PosX - -Jabber.BaseGame.Get.BackBufferWidth / 2.0f) < 400 * ScaleFactor)
            {
                finalimage.PosX = JabMath.LinearMoveTowards(finalimage.PosX, 0, gttf(dt) * 150 * ScaleFactor);

                if (finalimage.PosX == 0)//-Jabber.BaseGame.Get.BackBufferWidth / 3.0f)
                {
                    timer3 += gttf(dt) / 5.5f;
                }
                if (timer3 > 1.0f)
                {
                    RaiseFlag(Flags.DELETE);

                    WorldSelectScreen s = new WorldSelectScreen();
                    s.Initialize(BaseGame.Get.Content);
                    s.SetCurrentCountry("vesuvius");
                    ScreenManager.Get.AddScreen(s);
                }
            }
        }