91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 13KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-08-12
  • 語言: 其他
  • 標簽: Pygame??Tetris??

資源簡介

Pygame游戲源代碼:俄羅斯方塊 包含代碼、圖片、聲音等所有資源,可直接運行

資源截圖

代碼片段和文件信息

#!/usr/bin/env?python

import?pygame
from?pygame.locals?import?*
from?pygame.time?import?*
from?sys?import?exit
from?random?import?*
from?shapebase?import?*
from?shapes?import?*

“““init?game“““
pygame.init()
screen?=?pygame.display.set_mode((800600)032)
pygame.display.set_caption(“Rusia?Block“)
icon?=?pygame.image.load(“py.jpg“)
pygame.display.set_icon(icon)
screen.fill((160160160))

“““some?value?use?in?main?loop“““
shapeslist?=?[[[0?for?a?in?range(4)]?for?b?in?range(20)]?for?c?in?range(16)]##all?droped?block
cur_pos?=?[[0?for?a?in?range(2)]?for?b?in?range(4)]#current?droping?block‘position4?block?[xy]
rgb?=?[0?for?a?in?range(3)]#current?droping?block‘s?rgb
bottom?=?True
right_pos?=?((0?for?a?in?range(2))?for?b?in?range(4))#current?droping?block‘rightshow?position
j?=?0
total_score?=?0


“““the?public?functions“““
def?newShape(cur_pos):
????“““create?a?new?random?shape“““
????i?=?randint(06)
????j?=?randint(03)
????rgb?=?[randint(0255)randint(0255)randint(0255)]
????if?i?==?0:#l2
????????if?j?==?0:
????????????cur_pos?=?[[719][718][717][617]]
????????elif?j?==?1:
????????????cur_pos?=?[[619][719][819][818]]
????????elif?j?==?2:
????????????cur_pos?=?[[719][819][718][717]]
????????elif?j?==?3:
????????????cur_pos?=?[[719][718][818][918]]
????????ashape?=?shapeL2(cur_posshapeslistrgb)
????if?i?==?1:#t
????????if?j?==?0:
????????????cur_pos?=?[[719][619][718][819]]
????????elif?j?==?1:
????????????cur_pos?=?[[719][718][717][818]]
????????elif?j?==?2:
????????????cur_pos?=?[[719][718][618][818]]
????????elif?j?==?3:
????????????cur_pos?=?[[719][718][717][618]]
????????ashape?=?shapeT(cur_posshapeslistrgb)
????if?i?==?2:#z
????????if?j?%?2?==?0:
????????????cur_pos?=?[[719][718][619][818]]
????????elif?j?%?2?==?1:
????????????cur_pos?=?[[719][718][618][617]]
????????ashape?=?shapeZ(cur_posshapeslistrgb)
????if?i?==?3:#l
????????if?j?==?0:
????????????cur_pos?=?[[719][718][717][817]]
????????elif?j?==?1:
????????????cur_pos?=?[[719][718][618][518]]
????????elif?j?==?2:
????????????cur_pos?=?[[719][619][718][717]]
????????elif?j?==?3:
????????????cur_pos?=?[[719][718][819][919]]
????????ashape?=?shapeL(cur_posshapeslistrgb)
????if?i?==?4:#z2
????????if?j?%?2?==?0:
????????????cur_pos?=?[[719][718][618][819]]
????????elif?j?%?2?==?1:
????????????cur_pos?=?[[719][718][818][817]]
????????ashape?=?shapeZ2(cur_posshapeslistrgb)
????if?i?==?5:#o
????????cur_pos?=?[[719][718][819][818]]
????????ashape?=?shapeO(cur_posshapeslistrgb)
????if?i?==?6:#i
????????if?j?%?2?==?0:
????????????cur_pos?=?[[719][718][717][716]]
????????elif?j?%?2?==?1:
????????????cur_pos?=?[[719][619][819][919]]
????????ashape?=?shapeI(cur_posshapeslistrgb)
????return?ashape?j

def?showChanged(screenrgbcur_pos):
????“““flesh?screen?while?k

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????7976??2008-09-10?20:20??main.py

?????文件??????14289??2008-09-06?11:15??py.jpg

?????文件???????2929??2008-09-10?20:20??shapebase.py

?????文件???????3522??2012-07-25?14:53??shapebase.pyc

?????文件??????10139??2008-09-10?12:31??shapes.py

?????文件??????16376??2012-07-25?14:53??shapes.pyc

-----------?---------??----------?-----??----

????????????????55231????????????????????6


評論

共有 條評論