|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
这是报错所在的py文件的代码:
import pygame
class Bullet1(pygame.sprite.Sprite):
def __init__(self, position):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load('Images1/bullet1.png').convert_alpha
self.rect =self.image.get_rect()
self.rect. left, self.rect.top = position
self.speed = 12
self.active = True
self.mask = pygame.mask.from_surface(self.image)
def move(self):
self.rect.top -= self.speed
if self.rect.top < 0:
self.active = False
def reset(self, position):
self.rect.left, self.rect.top = position
self.active = True
这是错误提示:
File "C:\Users\asus\Desktop\bullet.py", line 10, in __init__
self.rect = self.image.get_rect()
AttributeError: 'builtin_function_or_method' object has no attribute 'get_rect'
|
|