Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def __add_components(self):
- # canvas
- self.canvas = tk.Canvas(self.root, bg='lightgrey', width=450, height=450, bd=0, highlightthickness=0)
- self.canvas.bind('<Button-1>', self.click_canvas)
- self.canvas.place(x=130, y=12)
- # start button
- self.start_button = tk.Button(self.root, command=self.begin_game, bg="lightgrey", fg="black", font="叶根友毛笔行书2.0版 15 bold", text="开始")
- self.start_button.place(x=35, y=100)
- # Tip button
- self.tip_button = tk.Button(self.root, command=self.pause_sys, bg="lightgrey", fg="black", font="叶根友毛笔行书2.0版 15 bold", text="暂停")
- self.tip_button.place(x=35, y=160)
- # end button
- self.exit_button = tk.Button(self.root, command=self.tip, bg="lightgrey", fg="black", font="叶根友毛笔行书2.0版 15 bold", text="提示")
- self.exit_button.place(x=35, y=220)
- # resort button
- self.resort_button = tk.Button(self.root, command=self.resort, bg="lightgrey", fg="black", font="叶根友毛笔行书2.0版 15 bold", text="重排")
- self.resort_button.place(x=35, y=280)
- # score show
- self.show_score = tk.Label(self.root, bg="lightgrey", fg="red", font="叶根友毛笔行书2.0版 15 bold", text=f"分数n{self.__score}")
- self.show_score.place(x=35, y=20)
- if self.level_ or self.base_ is True:
- # time cartoon
- self.time_counter = tk.Canvas(self.root, width=22, height=180, bg="yellow")
- self.time_counter.place(x=615, y=80)
- # time show
- self.show_time = tk.Label(self.root, bg="lightgrey", fg="purple", font="叶根友毛笔行书2.0版 15 bold", text=f"剩余时间n{self.__time}s")
- self.show_time.place(x=590, y=20)
- def begin_game(self):
- # segment picture
- self.extract_small_icon_list()
- # init map
- self.init_map()
- # link picture and map
- self.draw_map()
- self.__game_start = True
- if self.level_ or self.base_ is True:
- self.counter()
- self.start_button.configure(state=tk.DISABLED)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement