当前位置:网站首页>Tkinter Huarong Road 4x4 tutorial II
Tkinter Huarong Road 4x4 tutorial II
2022-07-04 09:01:00 【Mh_ Python_ learn】
tkinter Game hua-rong-dao 4x4 Tutorial 2
The process :
1. Based on the design of huarongdao interface, the judgment algorithm of huarongdao digital buttons is completed .
2. Explain python Dictionary creation , Refresh , data structure .
3.tkinter Control and explanation of objects .
The goal is :
1. Can use dictionary to store object information .
2. Program to control the button movement of Huarong Road
In the last part of the design, we completed the design of huarongdao interface , And use class functions to create 16 Button objects , Now we want to think about how to make these objects move , The design idea of the program is to use the structure of the dictionary , Put the object name and the object's x,y coordinate , Stored with the text of the object
hrd = { object : [x,y, Numbers ]}
We can choose to initialize the dictionary when the game interface is just created , Then create a button object to add a dictionary
import tkinter as t
import random
from tkinter import messagebox
class btn:# Class function to create a separate huarongdao button
def 边栏推荐
- Solve the problem of "Chinese garbled MySQL fields"
- Mac platform forgets the root password of MySQL
- Four essential material websites for we media people to help you easily create popular models
- There are 100 people eating 100 apples, one adult eating 4 apples, and four children eating 1 apple. How can they eat exactly 100 apples? Use any high-level language you are familiar with
- The upper layer route cannot Ping the lower layer route
- awk从入门到入土(8)数组
- Report on research and investment prospect prediction of China's electronic grade sulfuric acid industry (2022 Edition)
- HMS core helps baby bus show high-quality children's digital content to global developers
- Industry depression has the advantages of industry depression
- "How to connect the network" reading notes - Web server request and response (4)
猜你喜欢

C语言-入门-基础-语法-数据类型(四)

Relationship and operation of random events

Awk from entry to earth (12) awk can also write scripts to replace the shell

Ehrlich sieve + Euler sieve + interval sieve

How to play dapr without kubernetes?

How to re enable local connection when the network of laptop is disabled

保姆级JDEC增删改查练习
![Private collection project practice sharing [Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources](/img/f9/6c97697896cd1bd0f1d62542959f29.jpg)
Private collection project practice sharing [Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources

Jianzhi offer 09 realizes queue with two stacks

What should I do if there is a problem with the graphics card screen on the computer
随机推荐
Webapi interview question summary 01
awk从入门到入土(7)条件语句
awk从入门到入土(6)正则匹配
awk从入门到入土(9)循环语句
HMS core helps baby bus show high-quality children's digital content to global developers
Explain TCP protocol in detail three handshakes and four waves
什么是uid?什么是Auth?什么是验证器?
Report on research and investment prospect prediction of China's electronic grade sulfuric acid industry (2022 Edition)
Launchpad x | mode
awk从入门到入土(5)简单条件匹配
保姆级JDEC增删改查练习
Dede plug-in (multi-function integration)
Leetcode topic [array] - 121 - the best time to buy and sell stocks
Educational Codeforces Round 119 (Rated for Div. 2)
Go zero micro service practical series (IX. ultimate optimization of seckill performance)
Getting started with microservices: gateway gateway
Codeforces Round #803 (Div. 2)(A-D)
Four essential material websites for we media people to help you easily create popular models
Educational Codeforces Round 119 (Rated for Div. 2)
How does Xiaobai buy a suitable notebook