Exemplo n.º 1
0
        public void Update()
        {
            if (!m_hasPopped)
            {
                return;
            }

            m_physics.Update();

            if (!m_physics.IsProjected)
            {
                m_physics.Stop();

                if (m_transform.SclX > 0)
                {
                    m_transform.SclX -= m_shrinkSpeed * (float)Globals.TheGame.ElapsedTime;
                    m_transform.SclY -= m_shrinkSpeed * (float)Globals.TheGame.ElapsedTime;
                }
                else
                {
                    m_transform.SclX = 0;
                    m_transform.SclY = 0;
                }
            }
            else
            {
                m_transform.SclX -= m_shrinkSpeed * 0.3f * (float)Globals.TheGame.ElapsedTime;
                m_transform.SclY -= m_shrinkSpeed * 0.3f * (float)Globals.TheGame.ElapsedTime;
            }

            m_sprite.Alpha = m_transform.SclX * m_transform.SclX;
        }
Exemplo n.º 2
0
        public void Update()
        {
            float elapsed = (float)m_theGame.ElapsedTime;

            m_ttl -= elapsed;
            if (m_ttl < 0)
            {
                return;
            }

            float ratio = m_ttl / m_maxTTL;

            m_sprite.Alpha = (byte)(ratio * 255);

            m_physics.Update();
        }