public override void Enter()
        {
            _medalColorModifier.SetOscillating();
            _medalAlphaModifier.SetOscillating();

            Pax4Sound._current.PlayStateSong("Sound/lavaandiceWinParade");
            Pax4ParticleEffect._current.Enable();
            UpdateScore();

            base.Enter();
        }
        public Pax4UiStateLavaAndIceVictory(String p_name, Pax4Ui p_ui)
            : base(p_name, p_ui)
        {
            Vector2 position;
            float   duration = 0.5f;

            Pax4SpriteColorModifier colorModifierEnter = new Pax4SpriteColorModifier("", null);

            colorModifierEnter.Ini(Color.Black, Color.White, duration);
            AddStateEnterModifier(colorModifierEnter);
            Pax4SpriteColorModifier colorModifierExit = new Pax4SpriteColorModifier("", null);

            colorModifierExit.Ini(Color.White, Color.Black, duration);
            AddStateExitModifier(colorModifierExit);

            Pax4SpriteAlphaModifier alphaModifierEnter = new Pax4SpriteAlphaModifier("", null);

            alphaModifierEnter.Ini(0.0f, 1.0f, duration);
            AddStateEnterModifier(alphaModifierEnter);
            Pax4SpriteAlphaModifier alphaModifierExit = new Pax4SpriteAlphaModifier("", null);

            alphaModifierExit.Ini(1.0f, 0.0f, duration);
            AddStateExitModifier(alphaModifierExit);
            //Pax4SpritePositionModifier positionModifierEnter = null;
            //Pax4SpritePositionModifier positionModifierExit = null;
            //Pax4SpriteTextModifier textModifier = null;
            Pax4SpriteTextNumberModifier textNumberModifier = null;

            //float delay = 0.0f;
            Vector2 position0 = Vector2.Zero;
            Vector2 position1 = Vector2.Zero;

            String    textureName = null;
            Texture2D texture     = null;
            //SpriteFont spriteFont = null;
            Pax4Sprite sprite = null;

            //**************************************************
            //bg
            //**************************************************
            position.X = 63.0f;
            position.Y = 145.0f;
            //misc
            sprite = new Pax4SpriteTexture("lavaandiceMenuBg", null);
            AddChild(sprite);
            textureName = "Sprite/lavaandiceInGameVictoryBg";
            texture     = Pax4Texture2D._current.Get(textureName);
            ((Pax4SpriteTexture)sprite).SetTexture(texture);
            sprite.SetPosition(position);
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            //**************************************************
            //buttons
            //**************************************************

            sprite = new Pax4Button("lavaandiceMenuExit", null);
            AddChild(sprite);
            textureName = "Sprite/lavaandiceExitBtn";
            texture     = Pax4Texture2D._current.Get(textureName);
            ((Pax4Button)sprite).SetTexture(texture);
            textureName = "Sprite/lavaandiceExitBtnOver";
            texture     = Pax4Texture2D._current.Get(textureName);
            ((Pax4Button)sprite).SetTextureOver(texture);
            ((Pax4Button)sprite).SetOnClick(this.lavaandiceExitBtn_Click);
            position.X = 126.0f;
            position.Y = 368.0f;
            sprite.SetPosition(position);
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            sprite = new Pax4Button("lavaandiceMenuRetry", null);
            AddChild(sprite);
            textureName = "Sprite/lavaandiceRetryBtn";
            texture     = Pax4Texture2D._current.Get(textureName);
            ((Pax4Button)sprite).SetTexture(texture);
            textureName = "Sprite/lavaandiceRetryBtnOver";
            texture     = Pax4Texture2D._current.Get(textureName);
            ((Pax4Button)sprite).SetTextureOver(texture);
            ((Pax4Button)sprite).SetOnClick(this.lavaandiceRetryBtn_Click);
            position.X = 126.0f;
            position.Y = 496.0f;
            sprite.SetPosition(position);
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            sprite = new Pax4Button("lavaandiceMenuContinue", null);
            AddChild(sprite);
            textureName = "Sprite/lavaandiceContinueBtn";
            texture     = Pax4Texture2D._current.Get(textureName);
            ((Pax4Button)sprite).SetTexture(texture);
            textureName = "Sprite/lavaandiceContinueBtnOver";
            texture     = Pax4Texture2D._current.Get(textureName);
            ((Pax4Button)sprite).SetTextureOver(texture);
            ((Pax4Button)sprite).SetOnClick(this.lavaandiceContinueBtn_Click);
            position.X = 126.0f;
            position.Y = 624.0f;
            sprite.SetPosition(position);
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            //**************************************************
            //create
            //**************************************************
            float xpos = 0.0f;
            //float xstep = 0.0f;
            //float xoff = 0.0f;

            float ypos  = 0.0f;
            float ystep = 0.0f;
            //float yoff = 0.0f;

            float scale;

            //Difficulty
            xpos       = 105.0f;
            ypos       = 246.0f;
            sprite     = new Pax4SpriteText("difficulty", null);
            position.X = xpos;
            position.Y = ypos;
            scale      = 0.55f;
            sprite.SetPosition(position);
            sprite.SetColor(Color.White);
            ((Pax4SpriteText)sprite).SetSpriteFont("SpriteFont/ArialBold");
            ((Pax4SpriteText)sprite).SetScale(scale);
            ((Pax4SpriteText)sprite).SetText("Difficulty:");
            AddChild(sprite);
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            //Difficulty Value
            xpos       = 210.0f;
            ypos       = 246.0f;
            ystep      = 30.0f;
            sprite     = new Pax4SpriteText("difficultyValue", null);
            position.X = xpos;
            position.Y = ypos; ypos += ystep;
            scale      = 0.60f;
            sprite.SetPosition(position);
            sprite.SetColor(Color.OrangeRed);
            ((Pax4SpriteText)sprite).SetSpriteFont("SpriteFont/ArialBold");
            ((Pax4SpriteText)sprite).SetScale(scale);
            ((Pax4SpriteText)sprite).SetText("Hard");
            AddChild(sprite);
            _difficultySprite = sprite;
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            //Score
            xpos       = 105.0f;
            sprite     = new Pax4SpriteText("score", null);
            position.X = xpos;
            position.Y = ypos;
            scale      = 0.65f;
            sprite.SetPosition(position);
            sprite.SetColor(Color.White);
            ((Pax4SpriteText)sprite).SetSpriteFont("SpriteFont/ArialBold");
            ((Pax4SpriteText)sprite).SetScale(scale);
            ((Pax4SpriteText)sprite).SetText("Score:");
            AddChild(sprite);
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            //Score value
            xpos       = 188.0f;
            sprite     = new Pax4SpriteText("scoreValue", null);
            position.X = xpos;
            position.Y = ypos - 1.0f; ypos += ystep;
            scale      = 0.75f;
            sprite.SetPosition(position);
            sprite.SetColor(Color.GreenYellow);
            ((Pax4SpriteText)sprite).SetSpriteFont("SpriteFont/ArialBold");
            ((Pax4SpriteText)sprite).SetScale(scale);
            ((Pax4SpriteText)sprite).SetText("100,000,000");
            AddChild(sprite);
            _scoreSprite = sprite;
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            textNumberModifier = new Pax4SpriteTextNumberModifier("", null);
            textNumberModifier.AddChild(sprite);
            //textNumberModifier.Ini(1000000.0f, 0.0f, true, 10.0f);
            AddStateEnterModifier(textNumberModifier);
            _currentScoreModifier = textNumberModifier;

            //Total Score
            xpos       = 105.0f;
            sprite     = new Pax4SpriteText("totalScore", null);
            position.X = xpos;
            position.Y = ypos + 5.0f;
            scale      = 0.50f;
            sprite.SetPosition(position);
            sprite.SetColor(Color.White);
            ((Pax4SpriteText)sprite).SetSpriteFont("SpriteFont/ArialBold");
            ((Pax4SpriteText)sprite).SetScale(scale);
            ((Pax4SpriteText)sprite).SetText("Total Score:");
            AddChild(sprite);
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            //Total Score value
            xpos       = 222.0f;
            ypos       = ypos + 4.0f;
            sprite     = new Pax4SpriteText("totalScoreValue", null);
            position.X = xpos;
            position.Y = ypos;
            scale      = 0.55f;
            sprite.SetPosition(position);
            sprite.SetColor(Color.GreenYellow);
            ((Pax4SpriteText)sprite).SetSpriteFont("SpriteFont/ArialBold");
            ((Pax4SpriteText)sprite).SetScale(scale);
            ((Pax4SpriteText)sprite).SetText("100,000,000");
            AddChild(sprite);
            _totalScoreSprite = sprite;
            colorModifierEnter.AddChild(sprite);
            colorModifierExit.AddChild(sprite);
            alphaModifierEnter.AddChild(sprite);
            alphaModifierExit.AddChild(sprite);

            textNumberModifier = new Pax4SpriteTextNumberModifier("", null);
            textNumberModifier.AddChild(sprite);
            //textNumberModifier.Ini(0.0f, 10000000.0f, true, 10.0f);
            AddStateEnterModifier(textNumberModifier);
            _totalScoreModifier = textNumberModifier;

            //**************************************************
            //create medal sprites
            //**************************************************
            if (_medalSprite == null)
            {
                _medalSprite = new Dictionary <String, Pax4Sprite>();
            }
            else
            {
                return;
            }

            duration            = 0.2f;
            _medalColorModifier = new Pax4SpriteColorModifier("", null);
            _medalColorModifier.Ini(Color.White, Color.Black, duration);
            _medalColorModifier.SetOscillating();
            AddStateEnterModifier(_medalColorModifier);

            _medalAlphaModifier = new Pax4SpriteAlphaModifier("", null);
            _medalAlphaModifier.Ini(1.0f, 0.0f, duration);
            _medalAlphaModifier.SetOscillating();
            AddStateEnterModifier(_medalAlphaModifier);

            Dictionary <String, String> _medal = new Dictionary <String, String>();

            _medal.Add("nightmareOn", "Sprite/lavaandiceNightmareOn");
            _medal.Add("hardOn", "Sprite/lavaandiceHardOn");
            _medal.Add("normalOn", "Sprite/lavaandiceNormalOn");
            _medal.Add("easyOn", "Sprite/lavaandiceEasyOn");

            xpos = 335.0f;
            ypos = 250.0f;
            foreach (KeyValuePair <String, String> kvp in _medal)
            {
                textureName = kvp.Value;
                texture     = Pax4Texture2D._current.Get(textureName);
                sprite      = new Pax4SpriteTexture(kvp.Key, null);
                ((Pax4SpriteTexture)sprite).SetTexture(texture);
                sprite.SetPosition(new Vector2(xpos, ypos));
                sprite.SetScale(1.6f);
                _medalSprite.Add(sprite._name, sprite);

                _medalColorModifier.AddChild(sprite);
                _medalAlphaModifier.AddChild(sprite);

                colorModifierExit.AddChild(sprite);
                alphaModifierExit.AddChild(sprite);
            }

            _currentMedalSprite = sprite;
        }