猫史档案馆


【Python作品分享】新的作品

用户:春娇Vicky春娇Vicky查看:0 回复:1 评论:0 创建时间:2021-07-01T15:39:38


【作品展示】

center_image

 

【作品介绍】

请问哪里错了

 

【作品源代码】

import pygame,sys


pygame.init()
size = width,height = 600,400
print('game size:',size)#贴心的输出游戏尺寸
screen = pygame.display.set_mode(size)#set_mode
pygame.display.set_caption("fishC Demo")
bg = (0,0,0)#"数组变量"

position = 0#把它翻译成方向为0
font = pygame.font.Font(None,20)
line_height = font.get_linesize()
#pygame.font.Font()函数
screen.fill(bg)

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            sys.exit()
        screen.blit(font.render((str(event),True,(0,255,0),(0,position))

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
Python-happyyyyPython-happyyyy

最后一行代码:

1.括号漏了一个‘)’

screen.blit(font.render((str(event),True,(0,255,0),(0,position)))

2.bilt的参数有漏填

点赞0


评论