|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
子弹会在我放飞机的右侧中间发射出 不知道咋回事,求助大佬们
代码如下
class bullet1(pygame.sprite.Sprite):
def __init__(self, position):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.image.load('image/bullet1.png').convert_alpha()
self.rect = self.image.get_rect()
self.rect.left, self.rect.top = position
self.speed = 12
self.active = True
self.maks = 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, positon):
self.rect.left, self.rect.top = positon
self.active = True
# 发射子弹
if not (delay % 10):
bullet1[bullet1_index].reset(me.rect.midtop)
bullet1_index = (bullet1_index + 1) % bullet1_num |
|