Esempio n. 1
0
        /// <summary>
        /// Draws player representation to screen.
        /// </summary>
        public static void DrawDebugPlayer(DebugViewXNA debugView, Player player)
        {
            // draw player circle
            debugView.DrawCircle(player.Position, 20, Color.Blue);

            // Draw facing direction
            var directionVector = new Vector2((float)Math.Cos(player.Rotation), (float)Math.Sin(player.Rotation));

            debugView.DrawArrow(player.Position, player.Position + directionVector * 50, 25, 25, true, Color.Blue);

            // Draw player text
            var fontPos = FontToMapPosition(player.Position) + new Vector2(20, -20);// + (debugView.)

            debugView.DrawString((fontPos - FontLineSpacing * 4), string.Format("Name:{0}", player.Name));
            debugView.DrawString((fontPos - FontLineSpacing * 3), string.Format("Id:{0}", player.UniqueID));
            debugView.DrawString((fontPos - FontLineSpacing * 2), string.Format("Position:{0}", player.Position));
        }