猫史档案馆


【Python作品分享】黑客帝国代码雨【作品秀】

用户:加强伞√加强伞√查看:1 回复:2 评论:1 创建时间:2022-05-22T11:52:44


【作品展示】

center_image

 

【作品介绍】

装X

 

【作品源代码】

import random
import pygame

PANEL_width = 1080
PANEL_highly = 720
FONT_PX = 15
pygame.init()

winSur = pygame.display.set_mode((PANEL_width, PANEL_highly))

font = pygame.font.SysFont("SimHei", 22)

bg_suface = pygame.Surface((PANEL_width, PANEL_highly), flags=pygame.SRCALPHA)

pygame.Surface.convert(bg_suface)

bg_suface.fill(pygame.Color(0, 0, 0, 28))

winSur.fill((0, 0, 0))

letter = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i','j', 'k', 'l', 'm', 'n', 'o',"p","q","r","s","t","u","v","w","x","y","z"]
texts = [font.render(str(letter[i]), True, (0, 255, 0)) for i in range(15)]
column = int(PANEL_width / FONT_PX)
drops = [0 for i in range(column)]
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            exit()
        elif event.type == pygame.KEYDOWN:

            chang = pygame.key.get_pressed()
            if (chang[32]):
                exit()
    pygame.time.delay(30)
    winSur.blit(bg_suface, (0, 0))

    for i in range(len(drops)):
        text = texts[i%15]
        winSur.blit(text, (i * FONT_PX, drops[i] * FONT_PX))

        drops[i] += 1
        if drops[i] * 10 > PANEL_highly or random.random() > 0.95:
            drops[i] = 0

    pygame.display.flip()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
长大,是我们儿时的梦想长大,是我们儿时的梦想

good

点赞0


评论


断月q断月q

center_image

这貌似是Visual Studio Code

点赞0


评论