我很难获得第一个leason的帮助,每次打开它都会崩溃,而且我尝试了Eveything,但我无法使它起作用,任何帮助都会很棒这是我的代码bif = 'bg.jpg'mif = 'ball.png'import pygame, sysfrom pygame.locals import *pygame.init()screen = pygame.display.set_mode((640,360),0,32)background = pygame.image.load(bif).convert()mouse_c = pygame.image.load(mif).convert_alpha()while true: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() screen.blit(background, (0,0)) x,y = pygame.mouse.get_pos() x -= mouse_c.get_width()/2 y -= mouse_c.get_hight()/2 screen.blit(mouse_c,(x,y)) pygame.display.update()
1 回答
素胚勾勒不出你
TA贡献1827条经验 获得超9个赞
true您的while循环中的所有拳头都必须True大写,这将启动您的游戏循环
第二个height拼写错误
第20行应为:
y -= mouse_c.get_height()/2
那么它应该可以完美地工作
添加回答
举报
0/150
提交
取消
