改了大小

tzy_branch
DoubleQ 3 years ago
parent 4d0029a2ad
commit 9937a9ba1b

@ -40,7 +40,7 @@ def loadImages():#加载图片,a,b双方分别有象狮豹狼狐鹰鼠七个角
"b7", "b6", "b5", "b4", "b3", "b2", "b1", "b7", "b6", "b5", "b4", "b3", "b2", "b1",
] ]
for piece in pieces:#字典的形式存储图片 for piece in pieces:#字典的形式存储图片
IMAGES[piece] = pg.transform.scale(pg.image.load("./Image/pieces/pieces_rb/" + piece + ".png"), (SIZE, SIZE)) IMAGES[piece] = pg.transform.scale(pg.image.load("./Image/pieces/pieces_rb/" + piece + ".png"), (SIZE - 10, SIZE - 10))
tools = ["trap", "home1","home2"] tools = ["trap", "home1","home2"]
for tool in tools: for tool in tools:
@ -78,7 +78,8 @@ def drawPieces(screen,board):
for column in range(DIMENSION_COLUMNS): for column in range(DIMENSION_COLUMNS):
piece = board[row][column] piece = board[row][column]
if piece != "00": if piece != "00":
screen.blit(IMAGES[piece], pg.Rect((column * SIZE) + 10, (row * SIZE) + 200, SIZE, SIZE)) screen.blit(IMAGES[piece], pg.Rect((column * SIZE) + bias_left + 5, (row * SIZE) + bias_top + 5, SIZE - 10, SIZE - 10))
# square_selected 是当前选中的可以移动的棋子的位置 # square_selected 是当前选中的可以移动的棋子的位置
def protrudeSquares(screen,game_state,square_selected,valid_moves): def protrudeSquares(screen,game_state,square_selected,valid_moves):
@ -117,12 +118,12 @@ def startGamePage():#开始游戏界面Human/AI
WELCOME TO WELCOME TO
____ ___________ _____ _ ____ ____________ _____ _
/ __/ ___/ ___| / __ \ | / __/ ___/ __ | / __ \ |
|__| |___| |____ | / / |___ ___ ___ ___ |__| |___| |__| | | / / |___ ___ ___ ___
\__ | ___| ___ | | | _ \/ _ \/ __/ __| \__ | ___| _ / | | | _ \/ _ \/ __/ __|
__| | | | | | \__/\ | | | __/\__ \__ | __| | | | | \ \ | \__/\ | | | __/\__ \__ |
|____/_| |_| \_____/_| |_|\___||___/___/ |____/_| |_| \__| \_____/_| |_|\___||___/___/
################################################################ ################################################################

@ -199,6 +199,7 @@ class GameState:
if self.board[3][0][0] == 'r' or self.board[3][8][0] == 'b': if self.board[3][0][0] == 'r' or self.board[3][8][0] == 'b':
self.conquered = True self.conquered = True
return self.conquered return self.conquered
#移动操作 #移动操作
def makeMove(self,move):#cur是当前位置nxt是下一个位置,参数传入为元组 def makeMove(self,move):#cur是当前位置nxt是下一个位置,参数传入为元组
self.board[move.end_row][move.end_col] = self.board[move.start_row][move.start_col] self.board[move.end_row][move.end_col] = self.board[move.start_row][move.start_col]

Loading…
Cancel
Save