public override void Render(Graphics g) { if (World.GodMode) { double left = VPos.X - Bradius; double top = VPos.Y - Bradius; double size = Bradius * 2; g.DrawString("H: " + (int)Hunger, new Font(new FontFamily("Times New Roman"), 10f), new SolidBrush(Color.White), (float)left + (float)size + 5f, (float)top - 5f); g.DrawString("E: " + (int)Energy, new Font(new FontFamily("Times New Roman"), 10f), new SolidBrush(Color.White), (float)left + (float)size + 5f, (float)top - 15f); SteeringBehaviours.DrawBehaviors(g); HashTagLifeGoal.DrawGoal(g); } }
public override void Render(Graphics g) { double left = VPos.X - Bradius; double top = VPos.Y - Bradius; double size = Bradius * 2; g.FillEllipse(new SolidBrush(Color), (int)left, (int)top, (int)size, (int)size); g.DrawString("G", new Font(new FontFamily("Times New Roman"), 6f), new SolidBrush(Color.Black), (float)left, (float)top); g.DrawString(HashTagLifeGoal.GetGoalDescription(), new Font(new FontFamily("Times New Roman"), 8f), new SolidBrush(Color.Black), (float)left + 10, (float)top); base.Render(g); }
public override void Update(float time_elapsed) { HashTagLifeGoal?.Process(); Vector2D steeringForce = SteeringBehaviours.Calculate(); Vector2D acceleration = steeringForce.Divide(DMass); VVelocity.Add(acceleration.Multiply(time_elapsed)); VVelocity.Truncate(DMaxSpeed); VPos.Add(VVelocity.Multiply(time_elapsed)); if (VVelocity.LengthSquared() > 0.00000001) { VHeading = VVelocity.Clone().Normalize(); VSide = VHeading.Perpendicular(); } }