Giới thiệu sản phẩm
mport pygame
import random
import math
pygame.init()
win=pygame.display.set_mode((500,500))
pygame.display.set_caption('tetris')
class figure:
colors = [
(255, 0, 0), # Red
(0, 255, 0), # Green
(0, 0, 255), # Blue
(255, 255, 0), # Yellow
(0, 255, 255), # Cyan
(255, 0, 255), # Magenta
(192, 192, 192),# Silver
(128, 128, 128),# Gray
(128, 0, 0), # Maroon
(128, 128, 0), # Olive
(0, 128, 0), # Dark Green
(128, 0, 128), # Purple
(0, 128, 128), # Teal
(0, 0, 128) # Navy
]
figures=[
[[1,5,9,13],[4,5,6,7]],
[[1,2,5,9],[0,4,5,6],[1,5,9,8],[4,5,6,10]]
[[1,2,6,10],[5,6,7,9],[2,6,10,11],[3,5,6,7]]
[[1,4,5,6],[1,4,5,9],[4,5,6,9],[1,5,6,9],[1,2,5,6]],
]
def __init__(self,x,y):
self.x=x
self.y=y
self.type=random.randint(0,len(self.figures)-1)
self.color=random.randint(1,len(self.colors)-1)
self.rotation=0
Hình ảnh sản phẩm
Sản phẩm cùng tác giả
Sản phẩm liên quan
Không có sản phẩm nào
Đăng nhập để tham gia bình luận