Ok here is my code. My problem is everytime I update the screen I create
another set of Hex's and I cannot figure out the code to
build a list of objects that I can then destroy.
I know I posted I was going to fight with this, but I still can't get it
to work right.
for x in range(0,15):
for y in range (0,15):
if hexmap[x][y]==1:
makehex(self,x,y)
def makehex(self,x,y):
global colorarray,colormap,newmap
plotx = x * 18
ploty = y * 24
if x%2 == 0:
ploty = ploty + 12
self.MyAddShape(HexShape(36, 36), plotx, ploty,
wxPen(wxColour(90,90,90), 2, wxDOT),colorarray[colormap[x][y]],"")
class HexShape(wxPolygonShape):
def __init__(self, w=0.0, h=0.0):
wxPolygonShape.__init__(self)
if w == 0.0:
w = 24.0
if h == 0.0:
h = 24.0
points = [ (12,6,),
(6,18),
(12,30),
(24,30),
(30,18),
(24,6),
]
self.Create(points)