俄罗斯方块
(https://eyehere.net/2011/python-pygame-novice-professional-index/
https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=0&rsv_idx=1&tn=baidu&wd=python%20%E4%BF%84%E7%BD%97%E6%96%AF%E6%96%B9%E5%9D%97&rsv_pq=bb48dd0c00003b51&rsv_t=ef1aeI1tSDtV2W9ArDcBSrh9FiNeX6dK9cScnMl1uAeZgFETpEMxy6eCnfE&rqlang=cn&rsv_enter=1&rsv_sug3=18&rsv_sug1=20&rsv_sug7=100
)
#coding=utf-8
from tkinter import *
from random import *
import threading
from tkinter.messagebox import showinfo
from tkinter.messagebox import askquestion
import threading
from time import sleep
class BrickGame(object):
#是否开始
start = True;
#是否到达底部
isDown = True;
isPause = False;
#窗体
window = None;
#frame
frame1 = None;
frame2 = None;
#按钮
btnStart = None;
#绘图类
canvas = None;
canvas1 = None;
#标题
title = "IT Xiao Ang Zai";
#宽和高
width = 400;
height = 650;
#行和列
rows = 20;
cols = 10;
#下降方块的线程
downThread = None;
#几种方块
brick = [
[
[
[0,1,1],
[1,1,0],
[0,0,0]
],
[
[1,0,0],
[1,1,0],
[0,1,0]
],
[
[0,1,1],
[1,1,0],
[0,0,0]
],
[
[1,0,0],
[1,1,0],
[0,1,0]
]
],
[
[
[1,1,1],
[1,0,0],
[0,0,0]
],
[
[0,1,1],
[0,0,1],
[0,0,1]
],
[
[0,0,0],
[0,0,1],
[1,1,1]
],
[
[1,0,0],
[1,0,0],
[1,1,0]
]
],
[
[
[1,1,1],
[0,0,1],
[0,0,0]
],
[
[0,0,1],
[0,0,1],
[0,1,1]
],
[
[0,0,0],
[1,0,0],
[1,1,1]
],
[
[1,1,0],
[1,0,0],
[1,0,0]
]
],
[
[
[0,0,0],
[0,1,1],
[0,1,1]
],
[
[0,0,0],
[0,1,1],
[0,1,1]
],
[
[0,0,0],
[0,1,1],
[0,1,1]
],
[
[0,0,0],
[0,1,1],
[0,1,1]
]
],
[
[
[1,1,1],
[0,1,0],
[0,0,0]
],
[
[0,0,1],
[0,1,1],
[0,0,1]
],
[
[0,0,0],
[0,1,0],
[1,1,1]
],
[
[1,0,0],
[1,1,0],
[1,0,0]
]
],
[
[
[0,1,0],
[0,1,0],
[0,1,0]
],
[
[0,0,0],
[1,1,1],
[0,0,0]
],
[
[0,1,0],
[0,1,0],
[0,1,0]
],
[
[0,0,0],
[1,1,1],
[0,0,0]
]
],
[
[
[1,1,0],
[0,1,1],
[0,