bpred754 / Imperium

Real-Time Strategy game written with C# and Unity 3D Game Engine
1 stars 1 forks source link

Unit Formations #5

Closed bpred754 closed 9 years ago

bpred754 commented 9 years ago

When units are selected to move, determine a formation dependent on the number of units selected.

CurtisRose commented 9 years ago

I have finished this. Units are put into a new list when they are selected and a count variable is made and set based on the number of units in the list. This number is used to determine the size of the specific formation. For example: in the square formation it figures out the dimensions of the square and then places them into the formation. 4<X<=9 would be a 3X3 square 9<X<=16 would be a 4X4. The circle formation is similar. It increases the radius the more units are selected so that they will all fit without overlapping. I thought those two formations were enough for now to show the concept behind the helper methods and prove that it works.