speed dial

Python 中国象棋源码 V1

谁说胖子不能爱 提交于 2020-08-09 11:03:46
Pygame 做的中国象棋,一直以来喜欢下象棋,写了 python 就拿来做一个试试,水平有限,电脑走法水平低,需要在下次版本中更新电脑走法,希望源码能帮助大家更好的学习 python。总共分为四个文件,chinachess.py 为主文件,constants.py 数据常量,pieces.py 棋子类,走法,computer.py 电脑走法计算。 链接: pan.baidu.com/s/1e1lzDiLT… 提取码:cskj chinachess.py 为主文件 import pygame import time import constants import pieces import computer class MainGame(): window = None Start_X = constants.Start_X Start_Y = constants.Start_Y Line_Span = constants.Line_Span Max_X = Start_X + 8 * Line_Span Max_Y = Start_Y + 9 * Line_Span player1Color = constants.player1Color player2Color = constants.player2Color Putdownflag = player1Color