Beispiel #1
0
 /// <summary>
 /// What do do on a mouse movement.
 /// </summary>
 /// <param name="e">View changed how?</param>
 void _controls_ViewChanged(RotationEventArgs e)
 {
     if (Player.State != EntityState.DEAD)
     {
         Player.TurnTo(MathHelper.directionFromPointToPoint(
                           new Vector2(
                               Player.X + Camera.Instance.XOffset,
                               Player.Y + Camera.Instance.YOffset),
                           e.Location));
         if (Player.Rotation.ToString() == "NaN")
         {
             Player.TurnTo(90);
         }
         Program.Client.send(ServerCommandTypes.ORIENTATION, (Player.Rotation / Math.PI * 180).ToString());
     }
 }
 void _input_ViewChanged(RotationEventArgs e)
 {
     Location = new Vector2(
         e.Location.X,
         e.Location.Y);
 }