|

楼主 |
发表于 2018-5-13 11:29:19
|
显示全部楼层
def canmove(clickid,ms_pt):
global click_ston
global select_ston
if clickid != -1: #当前位子是否有棋子
global click_ston
global select_ston
if select_ston.coller == click_ston.coller:
select_ston =click_ston
return False
else:
print('正确')
return True
else:
if select_ston.kind() == 'ju':
return canmove_ju(clickid,ms_pt,select_ston)
elif select_ston.kind() =='ma':
return canmove_ma(clickid,ms_pt,select_ston)
elif select_ston.kind() == 'pao':
return canmove_pao(clickid,ms_pt,select_ston)
elif select_ston.kind() == 'xiang':
return canmove_xiang(clickid,ms_pt,select_ston)
elif select_ston.kind() == 'shi':
return canmove_shi(clickid,ms_pt,select_ston)
elif select_ston.kind() == 'bing':
return canmove_bing(clickid,ms_pt,select_ston)
elif select_ston.kind() == 'jiang':
return canmove_jiang(clickid,ms_pt,select_ston)
else :
return False
|
|