[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Pygame and WxWindows
- To: pygame-users@seul.org
- Subject: Re: [pygame] Pygame and WxWindows
- From: Mike Wagman <mwagman@charter.net>
- Date: Thu, 01 Jan 2004 18:44:55 -0600
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 01 Jan 2004 19:45:07 -0500
- In-reply-to: <1072521007.25066.1.camel@24-196-92-11.jvl.wi.charter.com>
- References: <20031212220533.6142.qmail@web10605.mail.yahoo.com> <3FED0F71.8000407@shinners.org> <1072521007.25066.1.camel@24-196-92-11.jvl.wi.charter.com>
- Reply-to: pygame-users@seul.org
- Sender: owner-pygame-users@seul.org
I'm getting there.
However every time I move the mouse it calls an update and the screen
flashes black.
from wxPython.wx import *
from Numeric import *
import random
from wxPython.ogl import *
from time import *
from cpcalc import *
import sys
import cPickle
import pygame
import os
import time
from pygame.locals import *
global mapname,cfopen,bcolorarray
global hexmap,playerstart,playermap,colormap,tcolormap,playerarray,tplayerstart,mapname,registered
bcolorarray = [(wx.wxBrush(wxColour(255,0,0),wxSOLID)),
(wx.wxBrush(wxColour(0,255,0),wxSOLID)),
(wx.wxBrush(wxColour(0,0,255),wxSOLID)),
(wx.wxBrush(wxColour(255,255,0),wxSOLID)),
(wx.wxBrush(wxColour(255,0,255),wxSOLID)),
(wx.wxBrush(wxColour(150,150,0),wxSOLID)),
(wx.wxBrush(wxColour(255,255,255),wxSOLID)),
(wx.wxBrush(wxColour(0,0,0),wxSOLID)),
(wx.wxBrush(wxColour(0,255,255),wxSOLID))]
colorarray = [(255,0,0),(0,255,0),(0,0,255),(255,255,0),(255,0,255),(150,150,0),(255,255,255),(0,0,0),(0,255,255)]
playermap = zeros((15,15))
playerstart = [(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0 )]
playerarray = zeros((7))
playerarray[1]=1
playerarray[4]=1
cfopen =0
class wxSDLWindow(wxFrame):
def __init__(self, parent, id, title = 'SDL window', **options):
options['style'] = wxDEFAULT_FRAME_STYLE | wxTRANSPARENT_WINDOW
wxFrame.__init__(*(self, parent, id, title), **options)
global pa,pb,pc,pd,pe,pf
global ta,tb,tc,td,te,tf,tg,th,ti,tj,tk,tl,tm,tn,to
self._initialized = 0
self._resized = 0
self._surface = None
self.__needsDrawing = 1
a=wxButton(self,11,"", pos=wxPoint(600,308),size=wxSize(20,20))
b=wxButton(self,12,"", pos=wxPoint(600,328),size=wxSize(20,20))
c=wxButton(self,13,"", pos=wxPoint(600,348),size=wxSize(20,20))
d=wxButton(self,14,"", pos=wxPoint(620,308),size=wxSize(20,20))
e=wxButton(self,15,"", pos=wxPoint(620,328),size=wxSize(20,20))
f=wxButton(self,16,"", pos=wxPoint(620,348),size=wxSize(20,20))
g=wxButton(self,17,"", pos=wxPoint(640,308),size=wxSize(20,20))
h=wxButton(self,18,"", pos=wxPoint(640,328),size=wxSize(20,20))
i=wxButton(self,19,"", pos=wxPoint(640,348),size=wxSize(20,20))
wxButton(self,20,"New Game", pos=wxPoint(600,10),size=wxSize(120,20))
wxButton(self,32,"Load Map", pos=wxPoint(600,30),size=wxSize(120,20))
wxButton(self,31,"Configure Game", pos=wxPoint(600,50),size=wxSize(120,20))
tj=wxStaticText(self,-1,"Player 1",wxPoint(620,102))
tk=wxStaticText(self,-1,"Player 2",wxPoint(620,122))
tl=wxStaticText(self,-1,"Player 3",wxPoint(620,142))
tm=wxStaticText(self,-1,"Player 4",wxPoint(620,162))
tn=wxStaticText(self,-1,"Player 5",wxPoint(620,182))
to=wxStaticText(self,-1,"Player 6",wxPoint(620,202))
pa=wxButton(self,21,"", pos=wxPoint(600,100),size=wxSize(20,20))
pb=wxButton(self,22,"", pos=wxPoint(600,120),size=wxSize(20,20))
pc=wxButton(self,23,"", pos=wxPoint(600,140),size=wxSize(20,20))
pd=wxButton(self,24,"", pos=wxPoint(600,160),size=wxSize(20,20))
pe=wxButton(self,25,"", pos=wxPoint(600,180),size=wxSize(20,20))
pf=wxButton(self,26,"", pos=wxPoint(600,200),size=wxSize(20,20))
a.SetForegroundColour(wxColour(255,0,0))
a.SetBackgroundColour(wxColour(255,0,0))
b.SetForegroundColour(wxColour(0,255,0))
b.SetBackgroundColour(wxColour(0,255,0))
c.SetForegroundColour(wxColour(0,0,255))
c.SetBackgroundColour(wxColour(0,0,255))
d.SetForegroundColour(wxColour(255,255,0))
d.SetBackgroundColour(wxColour(255,255,0))
e.SetForegroundColour(wxColour(255,0,255))
e.SetBackgroundColour(wxColour(255,0,255))
f.SetForegroundColour(wxColour(150,150,0))
f.SetBackgroundColour(wxColour(150,150,0))
g.SetForegroundColour(wxColour(255,255,255))
g.SetBackgroundColour(wxColour(255,255,255))
h.SetForegroundColour(wxColour(0,0,0))
h.SetBackgroundColour(wxColour(0,0,0))
i.SetForegroundColour(wxColour(0,255,255))
i.SetBackgroundColour(wxColour(0,255,255))
EVT_BUTTON(self, 31, self.Config)
#EVT_BUTTON(self, 20, self.NewGame)
EVT_IDLE(self, self.OnIdle)
setupmap()
def Config(self,evt):
global cfopen
if cfopen==0:
self.frame = CW()
self.frame.Show( true )
def Button(self,evt):
print "pressed"
def OnIdle(self, ev):
if not self._initialized or self._resized:
if not self._initialized:
# get the handle
hwnd = self.GetHandle()
os.environ['SDL_WINDOWID'] = str(hwnd)
if sys.platform == 'win32':
os.environ['SDL_VIDEODRIVER'] = 'windib'
pygame.init()
EVT_SIZE(self, self.OnSize)
self._initialized = 1
else:
self._resized = 0
x,y = self.GetSizeTuple()
self._surface = pygame.display.set_mode((x,y))
if self.__needsDrawing:
self.draw()
def OnPaint(self, ev):
self.__needsDrawing = 1
def OnSize(self, ev):
self._resized = 1
ev.Skip()
def draw(self):
raise NotImplementedError('please define a .draw() method!')
def getSurface(self):
return self._surface
class CircleWindow(wxSDLWindow):
"draw a circle in a wxPython / PyGame window"
def draw(self):
global hexmap,colorarray,colormap,bcolorarray
global ta,tb,tc,td,te,tf,tg,th,ti,tj,tk,tl,tm,tn,to
global pa,pb,pc,pd,pe,pf
multx=180/mapx(hexmap)
multy=120/mapy(hexmap)
mult = min(multx,multy)
ml1=mult
ml2=mult*2
ml3=mult*3
ml4=mult*4
ml5=mult*5
ml6=mult*6
surface = self.getSurface()
if not surface is None:
topcolor = 5
bottomcolor = 100
pygame.draw.rect(surface,(200,200,200),(0,0,760,560),0)
for plotx in range (0,len(hexmap)):
for ploty in range (0,len(hexmap)):
if hexmap[plotx][ploty]==1:
x = plotx * ml3
y = ploty * ml4
#x = x +5
#y = y +10
if plotx%2 == 0:
y = y + ml2
points = [ (x+ml2,y+ml1,),(x+ml1,y+ml3),(x+ml2,y+ml5),(x+ml4,y+ml5),(x+ml5,y+ml3),(x+ml4,y+ml1)]
color=colorarray[colormap[plotx][ploty]]
pygame.draw.polygon(surface,color,points,0)
pygame.draw.polygon(surface, (120,120,120),points ,2)
font = pygame.font.Font(None, 18)
text = font.render("Player 1", 1, (20, 20, 20))
surface.blit(text, (625,100))
text = font.render("Player 2", 1, (20, 20, 20))
surface.blit(text, (625,120))
text = font.render("Player 3", 1, (20, 20, 20))
surface.blit(text, (625,140))
text = font.render("Player 4", 1, (20, 20, 20))
surface.blit(text, (625,160))
text = font.render("Player 5", 1, (20, 20, 20))
surface.blit(text, (625,180))
text = font.render("Player 6", 1, (20, 20, 20))
surface.blit(text, (625,200))
text=font.render(playerstring(1),1,(20,20,20))
surface.blit(text,(675,100))
text=font.render(playerstring(2),1,(20,20,20))
surface.blit(text,(675,120))
text=font.render(playerstring(3),1,(20,20,20))
surface.blit(text,(675,140))
text=font.render(playerstring(4),1,(20,20,20))
surface.blit(text,(675,160))
text=font.render(playerstring(5),1,(20,20,20))
surface.blit(text,(675,180))
text=font.render(playerstring(6),1,(20,20,20))
surface.blit(text,(675,200))
#if playerarray[1]>0:
#pa.SetForegroundColour(128,128,128)
#pa.SetForegroundColour(bcolorarray[colormap[playerstart[1]]])
#pa.SetBackgroundColour(buttoncolor)
pygame.display.flip()
#time.sleep(2)
def playerstring(playernumber):
global playerarray
print playerarray
if playerarray[playernumber]==0:
retstring="None"
if playerarray[playernumber]==1:
retstring="Human"
if playerarray[playernumber]>1:
retstring="A.I."
return (retstring)
def pygametest():
mapname = "default.pmf"
loadit()
app = wxPySimpleApp()
sizeT = (760,560)
w = CircleWindow(None, -1, size = sizeT)
w.Show(1)
app.MainLoop()
def setupmap():
global colormap,hexmap,playerstart,playerarray,playernumber,buttoncolor,tplayerstart
global pt1,pt2,pt3,pt4,pt5,pt6,gamestarted,winner,playermap,tcolormap
playermap=zeros((len(hexmap),len(hexmap)))
for i in range (1,7):
if playerarray[i]>0:
colormap[playerstart[i]]=i-1
playermap[playerstart[i]]=i
print mapx(hexmap),mapy(hexmap)
for x in range (0,mapy(hexmap)):
for y in range (0,mapx(hexmap)):
if tcolormap[x][y]==0:
colormap[x][y]=random.randint(0,8)
if tcolormap[x][y]>0 and tcolormap[x][y]<7 and playerarray[tcolormap[x][y]]>0:
colormap[x][y] = (tcolormap[x][y])-1
playermap[x][y]=tcolormap[x][y]
if tcolormap[x][y]>9 and tcolormap[x][y]<19:
colormap[x][y]=(tcolormap[x][y])-10
if tcolormap[x][y]==7:
colorlist=buildcolorlist()
tx = random.randint(0,8)
while colorlist[tx]==1:
tx = random.randint(0,8)
colormap[x][y]=tx
if tcolormap[x][y]==8:
colorlist=buildcolorlist()
tx = random.randint(0,8)
while colorlist[tx]==0:
tx = random.randint(0,8)
colormap[x][y]=tx
for x in range(0,mapx(hexmap)):
for y in range (0,mapy(hexmap)):
if tcolormap[x][y]==9:
colorlist=buildplayercolorlist(x,y)
temp1=random.randint(0,8)
while colorlist[temp1]==1:
temp1=random.randint(0,8)
colormap[x][y]=temp1
for i in range(1,7):
if tplayerstart[i]!=(-1,-1):
colormap[tplayerstart[i]]=i-1
def buildplayercolorlist(x,y):
global colormap,playermap
colorlist=zeros((9))
for i in range (0,6):
tx,ty=move(x,y,i,1)
if tx < mapx(hexmap) and tx > -1 and ty < mapy(hexmap) and ty > -1:
if playermap[tx][ty]>0:
colorlist[colormap[tx][ty]]=1
return colorlist
def buildcolorlist():
global playerstart
colorlist=zeros((9))
for i in range (1,7):
if playerarray[i]>0:
colorlist[colormap[playerstart[i]]]=1
return (colorlist)
def loadit():
global hexmap,playerstart,playermap,colormap,tcolormap,playerarray,tplayerstart
file=open("default.pmf","r")
hexmap=cPickle.load(file)
tcolormap=cPickle.load(file)
tplayerstart=cPickle.load(file)
colormap= zeros((len(tcolormap),len(tcolormap[1])))
playermap = zeros((len(hexmap),len(hexmap)))
playerstart = [(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0 )]
for i in range (0,7):
playerarray[i]=1
if tplayerstart[i]==(0,0):
playerarray[i]=0
if tplayerstart[i]==(-1,-1):
playerarray[i]=0
print i
if i > 1 and playerarray[i] == 1:
playerarray[1]=2
if playerarray[1]>0:
playermap[tplayerstart[1]]=1
colormap[tplayerstart[1]]=0
playerstart[1]=tplayerstart[1]
if playerarray[2]>0:
playermap[tplayerstart[2]]=2
colormap[tplayerstart[2]]=1
playerstart[2]=tplayerstart[2]
if playerarray[3]>0:
playermap[tplayerstart[3]]=3
colormap[tplayerstart[3]]=2
playerstart[3]=tplayerstart[3]
if playerarray[4]>0:
playermap[tplayerstart[4]]=4
colormap[tplayerstart[4]]=3
playerstart[4]=tplayerstart[4]
if playerarray[5]>0:
playermap[tplayerstart[1]]=5
colormap[tplayerstart[5]]=4
playerstart[5]=tplayerstart[5]
if playerarray[6]>0:
playermap[tplayerstart[1]]=6
colormap[tplayerstart[6]]=5
playerstart[6]=tplayerstart[6]
def mapx(hexmap):
return len(hexmap[1])
def mapy(hexmap):
return len(hexmap)
def move(movex,movey,direction,distance):
even = ((0,-1),(1,0),(1,1),(0,1),(-1,1),(-1,0))
odd = ((0,-1),(1,-1),(1,0),(0,1),(-1,0),(-1,-1))
for i in range (0,distance):
if movex%2 == 0:
movex = movex + even[direction][0]
movey = movey + even[direction][1]
else:
movex = movex + odd[direction][0]
movey = movey + odd[direction][1]
return movex,move
class CW( wxFrame ):
def __init__( self ):
global cfopen
wxFrame.__init__( self, None, -1, "Configure Window")
self.SetSize( wxSize(600,370))
cfopen=1
global playerstart
global check_box1,check_box2,check_box3,check_box4,check_box5
global check_box6,check_box7,check_box8,check_box9,check_box10
global check_box11,check_box12,check_box13,check_box14,check_box15
global check_box16,check_box17,check_box18,check_box19,check_box20
global check_box21,check_box22,check_box23,check_box24,check_box25
global check_box26,check_box27,check_box28,check_box29,check_box30
wxStaticText(self,-1,"Player 1",wxPoint(10,42))
wxStaticText(self,-1,"Player 2",wxPoint(10,62))
wxStaticText(self,-1,"Player 3",wxPoint(10,82))
wxStaticText(self,-1,"Player 4",wxPoint(10,102))
wxStaticText(self,-1,"Player 5",wxPoint(10,122))
wxStaticText(self,-1,"Player 6",wxPoint(10,142))
wxStaticText(self,-1,"Inactive",wxPoint(60,22))
wxStaticText(self,-1,"Human",wxPoint(110,22))
wxStaticText(self,-1,"AI:Random",wxPoint(160,22))
wxStaticText(self,-1,"AI:Smart",wxPoint(230,22))
wxStaticText(self,-1,"AI:Spoiler",wxPoint(290,22))
check_box1 = wxCheckBox(self, 1, "", wxPoint(75, 40), wxSize(20, 20), wxNO_BORDER)
check_box2 = wxCheckBox(self, 2, "", wxPoint(115, 40), wxSize(20, 20), wxNO_BORDER)
check_box3 = wxCheckBox(self, 3, "", wxPoint(185, 40), wxSize(20, 20), wxNO_BORDER)
check_box4 = wxCheckBox(self, 4, "", wxPoint(245, 40), wxSize(20, 20), wxNO_BORDER)
check_box5 = wxCheckBox(self, 5, "", wxPoint(305, 40), wxSize(20, 20), wxNO_BORDER)
check_box6 = wxCheckBox(self, 6, "", wxPoint(75, 60), wxSize(20, 20), wxNO_BORDER)
check_box7 = wxCheckBox(self, 7, "", wxPoint(115, 60), wxSize(20, 20), wxNO_BORDER)
check_box8 = wxCheckBox(self, 8, "", wxPoint(185, 60), wxSize(20, 20), wxNO_BORDER)
check_box9 = wxCheckBox(self, 9, "", wxPoint(245, 60), wxSize(20, 20), wxNO_BORDER)
check_box10 = wxCheckBox(self, 10, "", wxPoint(305, 60), wxSize(20, 20), wxNO_BORDER)
check_box11 = wxCheckBox(self, 11, "", wxPoint(75, 80), wxSize(20, 20), wxNO_BORDER)
check_box12 = wxCheckBox(self, 12, "", wxPoint(115, 80), wxSize(20, 20), wxNO_BORDER)
check_box13 = wxCheckBox(self, 13, "", wxPoint(185, 80), wxSize(20, 20), wxNO_BORDER)
check_box14 = wxCheckBox(self, 14, "", wxPoint(245, 80), wxSize(20, 20), wxNO_BORDER)
check_box15 = wxCheckBox(self, 15, "", wxPoint(305, 80), wxSize(20, 20), wxNO_BORDER)
check_box16 = wxCheckBox(self, 16, "", wxPoint(75, 100), wxSize(20, 20), wxNO_BORDER)
check_box17 = wxCheckBox(self, 17, "", wxPoint(115, 100), wxSize(20, 20), wxNO_BORDER)
check_box18 = wxCheckBox(self, 18, "", wxPoint(185, 100), wxSize(20, 20), wxNO_BORDER)
check_box19 = wxCheckBox(self, 19, "", wxPoint(245, 100), wxSize(20, 20), wxNO_BORDER)
check_box20 = wxCheckBox(self, 20, "", wxPoint(305, 100), wxSize(20, 20), wxNO_BORDER)
check_box21 = wxCheckBox(self, 21, "", wxPoint(75, 120), wxSize(20, 20), wxNO_BORDER)
check_box22 = wxCheckBox(self, 22, "", wxPoint(115, 120), wxSize(20, 20), wxNO_BORDER)
check_box23 = wxCheckBox(self, 23, "", wxPoint(185, 120), wxSize(20, 20), wxNO_BORDER)
check_box24 = wxCheckBox(self, 24, "", wxPoint(245, 120), wxSize(20, 20), wxNO_BORDER)
check_box25 = wxCheckBox(self, 25, "", wxPoint(305, 120), wxSize(20, 20), wxNO_BORDER)
check_box26 = wxCheckBox(self, 26, "", wxPoint(75, 140), wxSize(20, 20), wxNO_BORDER)
check_box27 = wxCheckBox(self, 27, "", wxPoint(115, 140), wxSize(20, 20), wxNO_BORDER)
check_box28 = wxCheckBox(self, 28, "", wxPoint(185, 140), wxSize(20, 20), wxNO_BORDER)
check_box29 = wxCheckBox(self, 29, "", wxPoint(245, 140), wxSize(20, 20), wxNO_BORDER)
check_box30 = wxCheckBox(self, 30, "", wxPoint(305, 140), wxSize(20, 20), wxNO_BORDER)
EVT_CHECKBOX(self, 1, self.Check_Box1)
EVT_CHECKBOX(self, 2, self.Check_Box2)
EVT_CHECKBOX(self, 3, self.Check_Box3)
EVT_CHECKBOX(self, 4, self.Check_Box4)
EVT_CHECKBOX(self, 5, self.Check_Box5)
EVT_CHECKBOX(self, 6, self.Check_Box6)
EVT_CHECKBOX(self, 7, self.Check_Box7)
EVT_CHECKBOX(self, 8, self.Check_Box8)
EVT_CHECKBOX(self, 9, self.Check_Box9)
EVT_CHECKBOX(self, 10, self.Check_Box10)
EVT_CHECKBOX(self, 11, self.Check_Box11)
EVT_CHECKBOX(self, 12, self.Check_Box12)
EVT_CHECKBOX(self, 13, self.Check_Box13)
EVT_CHECKBOX(self, 14, self.Check_Box14)
EVT_CHECKBOX(self, 15, self.Check_Box15)
EVT_CHECKBOX(self, 16, self.Check_Box16)
EVT_CHECKBOX(self, 17, self.Check_Box17)
EVT_CHECKBOX(self, 18, self.Check_Box18)
EVT_CHECKBOX(self, 19, self.Check_Box19)
EVT_CHECKBOX(self, 20, self.Check_Box20)
EVT_CHECKBOX(self, 21, self.Check_Box21)
EVT_CHECKBOX(self, 22, self.Check_Box22)
EVT_CHECKBOX(self, 23, self.Check_Box23)
EVT_CHECKBOX(self, 24, self.Check_Box24)
EVT_CHECKBOX(self, 25, self.Check_Box25)
EVT_CHECKBOX(self, 26, self.Check_Box26)
EVT_CHECKBOX(self, 27, self.Check_Box27)
EVT_CHECKBOX(self, 28, self.Check_Box28)
EVT_CHECKBOX(self, 29, self.Check_Box29)
EVT_CHECKBOX(self, 30, self.Check_Box30)
print playerstart
if playerstart[1]!=(0,0):
check_box2.SetValue(1)
if playerstart[2]!=(0,0):
check_box8.SetValue(1)
if playerstart[3]!=(0,0):
check_box13.SetValue(1)
if playerstart[4]!=(0,0):
check_box18.SetValue(1)
if playerstart[5]!=(0,0):
check_box23.SetValue(1)
if playerstart[6]!=(0,0):
check_box28.SetValue(1)
EVT_CLOSE(self, self.EWOnClose)
def Check_Box1(self,evt):
global check_box1,check_box2,check_box3,check_box4,check_box5
global playerarray
playerarray[1]=0
check_box1.SetValue(1)
check_box2.SetValue(0)
check_box3.SetValue(0)
check_box4.SetValue(0)
check_box5.SetValue(0)
def Check_Box2(self,evt):
global check_box1,check_box2,check_box3,check_box4,check_box5
global playerarray
playerarray[1]=1
check_box1.SetValue(0)
check_box2.SetValue(1)
check_box3.SetValue(0)
check_box4.SetValue(0)
check_box5.SetValue(0)
def Check_Box3(self,evt):
global check_box1,check_box2,check_box3,check_box4,check_box5
global playerarray
playerarray[1]=2
check_box1.SetValue(0)
check_box2.SetValue(0)
check_box3.SetValue(1)
check_box4.SetValue(0)
check_box5.SetValue(0)
def Check_Box4(self,evt):
global check_box1,check_box2,check_box3,check_box4,check_box5
global playerarray
playerarray[1]=3
check_box1.SetValue(0)
check_box2.SetValue(0)
check_box3.SetValue(0)
check_box4.SetValue(1)
check_box5.SetValue(0)
def Check_Box5(self,evt):
global check_box1,check_box2,check_box3,check_box4,check_box5
global playerarray
playerarray[1]=4
check_box1.SetValue(0)
check_box2.SetValue(0)
check_box3.SetValue(0)
check_box4.SetValue(0)
check_box5.SetValue(1)
def Check_Box6(self,evt):
global check_box6,check_box7,check_box8,check_box9,check_box10
global playerarray
playerarray[2]=0
check_box6.SetValue(1)
check_box7.SetValue(0)
check_box8.SetValue(0)
check_box9.SetValue(0)
check_box10.SetValue(0)
def Check_Box7(self,evt):
global check_box6,check_box7,check_box8,check_box9,check_box10
global playerarray
playerarray[2]=1
check_box6.SetValue(0)
check_box7.SetValue(1)
check_box8.SetValue(0)
check_box9.SetValue(0)
check_box10.SetValue(0)
def Check_Box8(self,evt):
global check_box6,check_box7,check_box8,check_box9,check_box10
global playerarray
playerarray[2]=2
check_box6.SetValue(0)
check_box7.SetValue(0)
check_box8.SetValue(1)
check_box9.SetValue(0)
check_box10.SetValue(0)
def Check_Box9(self,evt):
global check_box6,check_box7,check_box8,check_box9,check_box10
global playerarray
playerarray[2]=3
check_box6.SetValue(0)
check_box7.SetValue(0)
check_box8.SetValue(0)
check_box9.SetValue(1)
check_box10.SetValue(0)
def Check_Box10(self,evt):
global check_box6,check_box7,check_box8,check_box9,check_box10
global playerarray
playerarray[2]=4
check_box6.SetValue(0)
check_box7.SetValue(0)
check_box8.SetValue(0)
check_box9.SetValue(0)
check_box10.SetValue(1)
def Check_Box11(self,evt):
global check_box11,check_box12,check_box13,check_box14,check_box15
global playerarray
playerarray[3]=0
check_box11.SetValue(1)
check_box12.SetValue(0)
check_box13.SetValue(0)
check_box14.SetValue(0)
check_box15.SetValue(0)
def Check_Box12(self,evt):
global check_box11,check_box12,check_box13,check_box14,check_box15
global playerarray
playerarray[3]=1
check_box11.SetValue(0)
check_box12.SetValue(1)
check_box13.SetValue(0)
check_box14.SetValue(0)
check_box15.SetValue(0)
def Check_Box13(self,evt):
global check_box11,check_box12,check_box13,check_box14,check_box15
global playerarray
playerarray[3]=2
check_box11.SetValue(0)
check_box12.SetValue(0)
check_box13.SetValue(1)
check_box14.SetValue(0)
check_box15.SetValue(0)
def Check_Box14(self,evt):
global check_box11,check_box12,check_box13,check_box14,check_box15
global playerarray
playerarray[3]=3
check_box11.SetValue(0)
check_box12.SetValue(0)
check_box13.SetValue(0)
check_box14.SetValue(1)
check_box15.SetValue(0)
def Check_Box15(self,evt):
global check_box11,check_box12,check_box13,check_box14,check_box15
global playerarray
playerarray[3]=4
check_box11.SetValue(0)
check_box12.SetValue(0)
check_box13.SetValue(0)
check_box14.SetValue(0)
check_box15.SetValue(1)
def Check_Box16(self,evt):
global check_box16,check_box17,check_box18,check_box19,check_box20
global playerarray
playerarray[4]=0
check_box16.SetValue(1)
check_box17.SetValue(0)
check_box18.SetValue(0)
check_box19.SetValue(0)
check_box20.SetValue(0)
def Check_Box17(self,evt):
global check_box16,check_box17,check_box18,check_box19,check_box20
global playerarray
playerarray[4]=1
check_box16.SetValue(0)
check_box17.SetValue(1)
check_box18.SetValue(0)
check_box19.SetValue(0)
check_box20.SetValue(0)
def Check_Box18(self,evt):
global check_box16,check_box17,check_box18,check_box19,check_box20
global playerarray
playerarray[4]=2
check_box16.SetValue(0)
check_box17.SetValue(0)
check_box18.SetValue(1)
check_box19.SetValue(0)
check_box20.SetValue(0)
def Check_Box19(self,evt):
global check_box16,check_box17,check_box18,check_box19,check_box20
global playerarray
playerarray[4]=3
check_box16.SetValue(0)
check_box17.SetValue(0)
check_box18.SetValue(0)
check_box19.SetValue(1)
check_box20.SetValue(0)
def Check_Box20(self,evt):
global check_box16,check_box17,check_box18,check_box19,check_box20
global playerarray
playerarray[4]=4
check_box16.SetValue(0)
check_box17.SetValue(0)
check_box18.SetValue(0)
check_box19.SetValue(0)
check_box20.SetValue(1)
def Check_Box21(self,evt):
global check_box21,check_box22,check_box23,check_box24,check_box25
global playerarray
playerarray[5]=0
check_box21.SetValue(1)
check_box22.SetValue(0)
check_box23.SetValue(0)
check_box24.SetValue(0)
check_box25.SetValue(0)
def Check_Box22(self,evt):
global check_box21,check_box22,check_box23,check_box24,check_box25
global playerarray
playerarray[5]=1
check_box21.SetValue(0)
check_box22.SetValue(1)
check_box23.SetValue(0)
check_box24.SetValue(0)
check_box25.SetValue(0)
def Check_Box23(self,evt):
global check_box21,check_box22,check_box23,check_box24,check_box25
global playerarray
playerarray[5]=2
check_box21.SetValue(0)
check_box22.SetValue(0)
check_box23.SetValue(1)
check_box24.SetValue(0)
check_box25.SetValue(0)
def Check_Box24(self,evt):
global check_box21,check_box22,check_box23,check_box24,check_box25
global playerarray
playerarray[5]=3
check_box21.SetValue(0)
check_box22.SetValue(0)
check_box23.SetValue(0)
check_box24.SetValue(1)
check_box25.SetValue(0)
def Check_Box25(self,evt):
global check_box21,check_box22,check_box23,check_box24,check_box25
global playerarray
playerarray[5]=4
check_box21.SetValue(0)
check_box22.SetValue(0)
check_box23.SetValue(0)
check_box24.SetValue(0)
check_box25.SetValue(1)
def Check_Box26(self,evt):
global check_box26,check_box27,check_box28,check_box29,check_box30
global playerarray
playerarray[6]=0
check_box26.SetValue(1)
check_box27.SetValue(0)
check_box28.SetValue(0)
check_box29.SetValue(0)
check_box30.SetValue(0)
def Check_Box27(self,evt):
global check_box26,check_box27,check_box28,check_box29,check_box30
global playerarray
playerarray[6]=1
check_box26.SetValue(0)
check_box27.SetValue(1)
check_box28.SetValue(0)
check_box29.SetValue(0)
check_box30.SetValue(0)
def Check_Box28(self,evt):
global check_box26,check_box27,check_box28,check_box29,check_box30
global playerarray
playerarray[6]=2
check_box26.SetValue(0)
check_box27.SetValue(0)
check_box28.SetValue(1)
check_box29.SetValue(0)
check_box30.SetValue(0)
def Check_Box29(self,evt):
global check_box26,check_box27,check_box28,check_box29,check_box30
global playerarray
playerarray[6]=3
check_box26.SetValue(0)
check_box27.SetValue(0)
check_box28.SetValue(0)
check_box29.SetValue(1)
check_box30.SetValue(0)
def Check_Box30(self,evt):
global check_box26,check_box27,check_box28,check_box29,check_box30
global playerarray
playerarray[6]=4
check_box26.SetValue(0)
check_box27.SetValue(0)
check_box28.SetValue(0)
check_box29.SetValue(0)
check_box30.SetValue(1)
def EWOnClose(self,evt):
global cfopen
cfopen=0
self.Destroy()
pygametest()