我是pygame的新手,我想知道什么是错的,我该如何解决它,谢谢!当我打开它时,我的pygame也会关闭,这就是为什么我会使用这样的截图。如果你也可以解释为什么它快速关闭,那将是很棒的! !(pygame的1.9.2蟒蛇3.4.1,Windows 8中)在这里输入的形象描述] [1]pygame.surface类型错误:需要一个整数
#!/usr/bin/env python
import pygame, sys
from pygame.locals import *
pygame.init()
pygame.font.init()
pygame.display.set_caption('Primer juego de Gian Di Julio')
mainclock= pygame.time.Clock()
screen = pygame.display.set_mode((800,600))
pygame.mouse.set_visible(0)
#positioning the ship into the middle of the screen
ship = pygame.image.load('ship.png')
ship_top = screen.get_height() - ship.get_height()
ship_left = screen.get_width()/2 - ship.get_width()/2
pygame.Surface(ship,(ship_left,ship_top))
while True:
screen.fill((0,0,0))
x,y = pygame.mouse.get_pos()
screen.blit(ship, (x-ship.get.width()/2, ship_top))
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
pygame.display.update()
pygame.display.flip()