Exemplo n.º 1
0
 public void Trigger()
 {
     if (SceneManagement.SceneInfo.Player.GetComponent <CharacterStats>().Category == CharacterCategory.CC_PRIEST)
     {
         _physics.MoveTo(GameObject.Position - Microsoft.Xna.Framework.Vector2.UnitY * 180);
     }
 }
Exemplo n.º 2
0
 private void setPosition(Vector2 position)
 {
     if (_physics != null)
     {
         _physics.MoveTo(position);
     }
     else
     {
         GameObject.Position = position;
     }
 }
Exemplo n.º 3
0
        public override void Update(GameTime gameTime)
        {
            Vector2 diff  = Pivot.Position - GameObject.Position;
            float   angle = (float)Math.Atan2(diff.Y, diff.X);

            angle += RotationSpeed * (MathHelper.Pi / 180.0f) * (float)gameTime.ElapsedGameTime.TotalSeconds;

            Vector2 newPos = new Vector2((float)Math.Cos(angle) * diff.Length(), (float)Math.Sin(angle) * diff.Length());

            if (_physics != null)
            {
                _physics.MoveTo(newPos);
            }
            else
            {
                GameObject.Position = newPos;
            }
        }