示例#1
0
        public virtual void Update(TimeSpan elapsed)
        {
            m_lifeTime -= elapsed.TotalSeconds;

            var newPos = m_location.Position + m_move.Direction * (float)elapsed.TotalSeconds * (float)m_move.Speed;

            m_location.SetPosition(newPos);
        }
示例#2
0
        public Shoot(Vector2 position, Vector2 direction, Color4ub startColor, Color4ub endColor, float angle = 2, float radius = 2)
        {
            m_location = new LocationComponent(this);
            m_location.SetPosition(position);

            m_cone = new Cone(
                position,
                radius,
                angle,
                startColor,
                endColor,
                (float)((Math.Atan2(direction.Y, direction.X) + Math.PI * 2) - (angle / 2.0) - Math.PI * 2)
                );

            m_lifeTimeTotal = 0.2;
            m_lifeTime      = m_lifeTimeTotal;
        }
示例#3
0
 public void SetPosition(Vector2 position)
 {
     m_location.SetPosition(position);
 }
示例#4
0
 public void SetPosition(Vector2 position)
 {
     m_location.SetPosition(position);
     m_box = new Vector2(64, 64);
 }
示例#5
0
 public void SetPosition(Vector2 position)
 {
     m_location.SetPosition(position);
     m_cone.Center = position;
 }
示例#6
0
 public virtual void SetPosition(Vector2 position)
 {
     m_location.SetPosition(position);
     m_box = new Vector2(32, 36);
 }