0825上午进度

pull/1/head
DoubleQ 3 years ago
parent f70a9dcf80
commit 65e7664b0e

@ -6,7 +6,7 @@
### 一、游戏角色
> 象>狮>豹>狼>狐>鹰>鼠>[象]
> 象Eleph>狮Lion>豹Leo>狼Wolf>狐Fox>鹰Eag>鼠Mse>[象]
### 二、游戏规则
@ -62,7 +62,11 @@
游戏提示
ex.大致图像
![image-20220825111106122](C:\Users\DoubleQ\AppData\Roaming\Typora\typora-user-images\image-20220825111106122.png)
(a方在左 默认为红色b方在右 默认为蓝色)
#### 二、后端逻辑

@ -0,0 +1,90 @@
"""
Course: Programming practice
Students: Qu Qian /Tan Zhengyuan
"""
"""
Safafi Chess Game/SFF Chess Game
(Animal Chess Game)
Main code for run the game
it handle user input and GUI
"""
from curses import COLOR_GREEN, COLOR_YELLOW
from json import load
import pygame as pg
import sys
from time import process_time
#设置棋盘的参数
WIDTH = 800
HEIGHT = 1000
BOARD_WIDTH = 600
BOARD_HEIGHT = 800
MOVE_LOG_PANEL_WIDTH = 0
MOVE_LOG_PANEL_HEIGHT = BOARD_HEIGHT
DIMENSION = 8
DIMENSION_ROWS = 7
DIMENSION_COLUMNS = 9
SIZE = 64
IMAGES = {}
def loadImages():#加载图片,a,b双方分别有象狮豹狼狐鹰鼠七个角色
pieces = ["a7_Eleph", "a6_Lion", "a5_Leo", "a4_Wolf", "a3_Fox", "a2_Eag", "a1_Mse",
"b7_Eleph", "b6_Lion", "b5_Leo", "b4_Wolf", "b3_Fox", "b2_Eag", "b1_Mse",]
for piece in pieces:#字典的形式存储图片
IMAGES[piece] = pg.transform.scale(pg.image.load("./images/" + piece + ".png"), (SIZE, SIZE))
screen = pg.display.set_mode((BOARD_WIDTH + MOVE_LOG_PANEL_WIDTH, BOARD_HEIGHT))#设置窗口大小
screen.fill(COLOR_GREEN)
def drawBoardPieces(screen):#绘制棋盘:格子,河流,陷阱,巢穴 棋子14个棋子初始位置固定
for row in range(DIMENSION_ROWS):
for column in range(DIMENSION_COLUMNS):
def drawValidMoves(screen):#绘制可走的位置
for move in validMoves:
row, column = move
pg.draw.circle(screen, COLOR_YELLOW, (column * SIZE + SIZE // 2, row * SIZE + SIZE // 2), 15)
def drawMovelog(screen):#绘制移动日志
pass
def startGamePage():#开始游戏界面Human/AI
startpage = '''
WELCOME TO
____ ___________ _____ _
/ __/ ___/ ___| / __ \ |
|__| |___| |____ | / / |___ ___ ___ ___
\__ | ___| ___ | | | _ \/ _ \/ __/ __|
__| | | | | | \__/\ | | | __/\__ \__ |
|____/_| |_| \_____/_| |_|\___||___/___/
################################################################
Please type one of the numbers below to choose a playing mode:
( 1 ) - Human vs Human
( 2 ) - Human vs AI
( 3 ) - AI vs AI
( 4 ) - Quit
################################################################
'''
print(startpage)
# 选择游戏模式
not_selected = True
p1 , p2 = 0, 0
while
def GameOver(screen):#游戏结束,出现的文字以及图像
pass
if __name__ == '__main__':
pass
Loading…
Cancel
Save