def __init__(self, canvas, position): self.k = K() self.canvas = canvas self.position = position
def __init__(self, canvas): self.k = K() self.canvas = canvas self.enPassant = None self.color = None
def __init__(self, graphics): # globals self.k = K() self.graphics = graphics # canvas from graphics class self.canvas = graphics.canvas
def __init__(self, position, canvas): self.k = K() self.position = position self.canvas = canvas self.color = "none"
def __init__(self, canvas, position): # globals self.k = K() # canvas from graphics class self.canvas = canvas # position object from game class self.position = position
def __init__(self, root): self.k = K() self.createWindow(root) # create canvas self.canvas = Canvas(root) self.canvas.pack(expand = 1, fill = BOTH) self.loadImages() self.createImages()
def __init__(self, graphics, root): # global variables self.k = K() # piece - piece identifier. px, py - piece position(472x472). mx, my - mouse position(472x472) self.data = {"piece": None, "px": 0, "py": 0, "mx": 0, "my": 0} # keeps track of current turn self.color = "token" # true when menu is displayed, else false self.menuOn = False # tkinter root self.root = root # creates window and all images self.graphics = graphics # Canvas from graphics class. Tkinter object, draws images self.canvas = graphics.canvas # functions for special moves. self.specialMoves = SpecialMoves(self.canvas) # contains board and functions pertaining to position self.position = Position(self.canvas, self.specialMoves) self.position.updateBoard() # contains functions for moving pieces self.movement = Movement(self.canvas, self.position) # handles menues self.interface = Interface(graphics) # creates highlights around boxes self.highlight = Highlight(self.canvas, self.position) # finds move for computer player self.cpu = CPU(self.position, self.canvas) # brings up main menu, starts game self.showMain(0)