public override void Draw(SpriteBatch sb) { Attack.Draw(sb); Propellant.Draw(sb); Eyes.Draw(sb); base.Draw(sb); if (ShowInfo) { const int spacing = 6; var netStr = string.Empty; bool bottomReached = false; for (int depth = 0; !bottomReached; depth++) { netStr += depth < Brain.Net.Input.Length ? $"{Brain.Net.Input[depth].Output,-spacing:n2} ->" : " "; for (int hid = 0; hid < Brain.Net.Hidden.Length; hid++) { netStr += depth < Brain.Net.Hidden[hid].Length ? $" |{Brain.Net.Hidden[hid][depth].Output,-spacing:n2}" : " "; } netStr += depth < Brain.Net.Output.Length ? $" -> {Brain.Net.Output[depth].Output,-spacing:n2}" : " "; netStr += "\n"; bottomReached = depth >= Math.Max(Brain.Net.Input.Length, Brain.Net.Output.Length) && depth >= Brain.Net.Hidden.Max(h => h.Length); } sb.DrawString(World.Game.Res.FConsolas, $"H={Health} S={Speed} xy({(int)CenterPosition.X}, {(int)CenterPosition.Y})\n{netStr}", CenterPosition + new Vector2(0, Radius + 3), Microsoft.Xna.Framework.Color.Black); DrawHelper.DrawLine(sb, CenterPosition, GeomHelper.GetRelative(CenterPosition, MomentumAngle, Speed), 1, Microsoft.Xna.Framework.Color.DarkBlue); } }
public void Draw(SpriteBatch sb) { for (int ei = 0; ei < EyeCount; ei++) { var curVis = Visible[ei]; var col = new Color(curVis.X, curVis.Y, 0, curVis.Z); if (col.A > 0) { DrawHelper.DrawLine(sb, Owner.CenterPosition, GeomHelper.GetRelative(Owner.CenterPosition, EyeAngles[ei] + Owner.Rotation, VisionDistance), 1, col); } } }