AjaxVM / hiths-p4-pyweek6

Automatically exported from code.google.com/p/hiths-p4-pyweek6
0 stars 0 forks source link

Show stacked units... #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Ok, basically, we need to see a group of stars (one each) for units that
are *stacked*
So, a simple approach would simply add a variable into the Ship class.
Anytime a ship then finishes moving - it will iterate through all other
player ships.
Then any are within like 10 pixels from each other, you add it to teh new
variable, which should be a list.

Then we will have the state engine go through and find any ships with
anything in this attribute.
If they do they are added to a new list for each group.

Then render a star for each object, decreasing the y pos for each ship.

Original issue reported on code.google.com by RoeB...@gmail.com on 12 Sep 2008 at 2:45

GoogleCodeExporter commented 8 years ago
My suggestion would be to make a stack class. The ships have a variable for this
class and they check like you say, but they all link to the same stack object. 
Since
ships cannot move in groups, the stack will never change position. Either new 
ships
will join it, or all leave until only one ship remains (stack goes away). New 
stack
objects are made for new stacks.

This class renders itself, so it handles all the stars. I could take over this 
task
since I have an idea of what to do?

Original comment by archw...@gmail.com on 12 Sep 2008 at 3:32

GoogleCodeExporter commented 8 years ago
We decided for me to take this over.

Original comment by archw...@gmail.com on 12 Sep 2008 at 6:05