|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#游戏主逻辑
root = Tk()
root.title(" python连连看 ")
root.resizable(width=False, height=False)
#界面设计
frame_root = Frame(root)
frame_l = Frame(frame_root)
#布置按钮
B = Button(frame_root,text="开始游戏",command = gamestar,font="微软雅黑")
B.pack(side=LEFT, padx=10)
C = Button(frame_root,text="提 示",font="微软雅黑",activebackground="green",command = find2Block2)
C.pack(side=LEFT, padx=10)
D = Button(frame_root,text="暂 停",font="微软雅黑",activebackground="yellow")
D.pack(side=LEFT, padx=10)
lbl1 = Label(frame_root,text='')
lbl1.place(x = 10, y = 100 , width=180, height=30)
lbl2 = Label(frame_root,text=' -------倒计时(秒)------- ')
lbl2.place(x = 10, y = 70 , width=180, height=30)
frame_root.pack(side=LEFT)
frame_l.pack(side=RIGHT)
imgs= [PhotoImage(file='gif\\bar_0'+str(i)+'.gif') for i in range(0,10) ] #所有图标图案
Select_first=False #是否已经选中第一块
firstSelectRectId=-1 #被选中第一块地图对象
SecondSelectRectId=-1 #被选中第二块地图对象
clearFlag=False
linePointStack=[]
Line_id=[]
Height=10
Width=10
map = [[" " for y in range(Height)]for x in range(Width)]
image_map = [[" " for y in range(Height)]for x in range(Width)]
cv = Canvas(frame_l, bg = 'darkblue', width = 400, height = 400) #调节窗口大小和背景颜色
#drawQiPan( )
cv.bind("<Button-1>", callback) #鼠标左键事件
cv.bind("<Button-3>", find2Block) #鼠标右键事件
cv.pack(side=RIGHT, padx=10)
root.mainloop()
添加按钮后按钮是横着排布的 |
|