当前位置:网站首页>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
边栏推荐
- Launpad | 基础知识
- Solve the problem of "Chinese garbled MySQL fields"
- Live in a dream, only do things you don't say
- Basic discipline formula and unit conversion
- How does Xiaobai buy a suitable notebook
- Industry depression has the advantages of industry depression
- Codeforces Round #750 (Div. 2)(A,B,C,D,F1)
- C语言-入门-基础-语法-[主函数,头文件](二)
- Sequence model
- HMS core helps baby bus show high-quality children's digital content to global developers
猜你喜欢
awk从入门到入土(12)awk也可以写脚本,替代shell
Target detection -- intensive reading of yolov3 paper
How to play dapr without kubernetes?
How to re enable local connection when the network of laptop is disabled
C language - Introduction - Foundation - syntax - [main function, header file] (II)
How college students choose suitable computers
09 softmax regression + loss function
C language - Introduction - Foundation - syntax - data type (4)
What if the wireless network connection of the laptop is unavailable
HMS core helps baby bus show high-quality children's digital content to global developers
随机推荐
[attack and defense world | WP] cat
[error record] no matching function for call to 'cacheflush' cacheflush();)
Awk from entry to earth (14) awk output redirection
【无标题】转发最小二乘法
C語言-入門-基礎-語法-[運算符,類型轉換](六)
Awk from entry to penetration (6) regular matching
Opencv environment construction (I)
C language - Introduction - Foundation - syntax - [variable, constant light, scope] (V)
Manjaro install wechat
C语言-入门-基础-语法-[运算符,类型转换](六)
Awk from getting started to digging in (11) detailed explanation of awk getline function
In depth research and investment strategy report on China's hydraulic parts industry (2022 Edition)
Comparison between sentinel and hystrix
Research Report on research and investment prospects of China's testing machine industry (2022 Edition)
Awk from entry to earth (15) awk executes external commands
《网络是怎么样连接的》读书笔记 - Tcp/IP连接(二)
Leetcode topic [array] - 121 - the best time to buy and sell stocks
《网络是怎么样连接的》读书笔记 - 集线器、路由器和路由器(三)
manjaro安装微信
【LeetCode 42】501. Mode in binary search tree