Example #1
0
        public override void Update(GameTime gt)
        {
            fade = 1 - (Vector2.Distance(Position, m_StartingPosition) / m_MaxDistFromStart);

            if (Vector2.Distance(Position, m_StartingPosition) > m_MaxDistFromStart || m_Velocity.Length() <= 0.01f ||
                GetRect.Intersects(new Rectangle((int)Mouse.GetState().Position.X, (int)Mouse.GetState().Position.Y, 16, 16)))
            {
                m_isAlive = false;
            }

            base.Update(gt);
        }
Example #2
0
 public bool CheckCollision(Rectangle a_OtherRectangle)
 {
     return(GetRect.Intersects(a_OtherRectangle));
 }