X-Git-Url: https://git.ucc.asn.au/?p=progcomp2013.git;a=blobdiff_plain;f=qchess%2Fpiece.py;h=d9acef27eca98b2acf89a14cf2826c98d1deeb32;hp=5fd394376a66450ca12b3ac913cc9d20004e0c6b;hb=707e794d26062516eb4188d1cd2902929613c46b;hpb=bfa63f1a2dc9c66399f8159857d4cc54f038eaa2 diff --git a/qchess/piece.py b/qchess/piece.py index 5fd3943..d9acef2 100644 --- a/qchess/piece.py +++ b/qchess/piece.py @@ -41,15 +41,21 @@ class Piece(): return str(self.current_type) + " " + str(self.types) + " at " + str(self.x) + ","+str(self.y) # Draw the piece in a pygame surface - def draw(self, window, grid_sz = [80,80]): + def draw(self, window, grid_sz = [80,80], style="quantum"): # First draw the image corresponding to self.current_type img = images[self.colour][self.current_type] rect = img.get_rect() - offset = [-rect.width/2,-3*rect.height/4] + if style == "classical": + offset = [-rect.width/2, -rect.height/2] + else: + offset = [-rect.width/2,-3*rect.height/4] window.blit(img, (self.x * grid_sz[0] + grid_sz[0]/2 + offset[0], self.y * grid_sz[1] + grid_sz[1]/2 + offset[1])) + if style == "classical": + return + # Draw the two possible types underneath the current_type image for i in range(len(self.types)): if self.types_revealed[i] == True: