Beispiel #1
0
 /// <summary>
 /// Update this HurtableSprite.
 /// </summary>
 /// <param name="i_GameTime">Game time.</param>
 public override void Update(GameTime i_GameTime)
 {
     base.Update(i_GameTime);
     if (HurtInCase.HasFlag(eHurtInCase.Touch))
     {
         IntersectionManager intersectionManager = GameScreen.Services.GetService(typeof(IntersectionManager)) as IntersectionManager;
         intersectionManager.CheckAndActForIntersection(this);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Update the bullet on game space.
        /// </summary>
        /// <param name="i_GameTime">Game time.</param>
        public override void Update(GameTime i_GameTime)
        {
            if (SelfTeam == eTeam.Player)
            {
                m_selfLocation.Y -= (float)i_GameTime.ElapsedGameTime.TotalSeconds * sr_movementSpeed;
                if (m_selfLocation.Y <= 0)
                {
                    Destroy(0);
                }
            }
            else
            {
                m_selfLocation.Y += (float)i_GameTime.ElapsedGameTime.TotalSeconds * sr_movementSpeed;
                if (m_selfLocation.Y >= Game.Window.ClientBounds.Height)
                {
                    Destroy(0);
                }
            }

            IntersectionManager intersectionManager = GameScreen.Services.GetService(typeof(IntersectionManager)) as IntersectionManager;

            intersectionManager.CheckAndActForIntersection(this);
        }