|
|
@ -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
|
|
|
|
|
|
|
|
|
|
|
|
____ ___________ _____ _
|
|
|
|
____ ____________ _____ _
|
|
|
|
/ __/ ___/ ___| / __ \ |
|
|
|
|
/ __/ ___/ __ | / __ \ |
|
|
|
|
|__| |___| |____ | / / |___ ___ ___ ___
|
|
|
|
|__| |___| |__| | | / / |___ ___ ___ ___
|
|
|
|
\__ | ___| ___ | | | _ \/ _ \/ __/ __|
|
|
|
|
\__ | ___| _ / | | | _ \/ _ \/ __/ __|
|
|
|
|
__| | | | | | \__/\ | | | __/\__ \__ |
|
|
|
|
__| | | | | \ \ | \__/\ | | | __/\__ \__ |
|
|
|
|
|____/_| |_| \_____/_| |_|\___||___/___/
|
|
|
|
|____/_| |_| \__| \_____/_| |_|\___||___/___/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
################################################################
|
|
|
|