5
votes
4answers
234 views

Adjusting integer based on multiple elements in int array

I'm working with the following code which adjusts an int based on multiple elements of an integer array. I am wondering if there's a cleaner, easier-to-read construct for this: int Blue = 0; int[] ...
2
votes
2answers
114 views

Determine if an int is within range

Can I somehow make this a bit cleaner using Math.[Somthing], without making a method for it !? int MaxSpeed = 50; if (Speed.X > MaxSpeed) Speed.X = MaxSpeed; if (Speed.X < MaxSpeed * -1) ...