外星人游戏,子弹被拉长了
#绘制子弹精灵
bullets = pygame.sprite.Group()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_SPACE:
if len(bullets) < 5:
new_bullet = pygame.sprite.Sprite()
new_bullet.rect = pygame.Rect(0,0,3,15)
new_bullet.rect.midbottom = ship_rect.midtop
bullets.add(new_bullet)
print(len(bullets))
for bullet in bullets:
pygame.draw.rect(screen_image,bg_color2,bullet.rect)
bullet.rect.y -= 1
pygame.display.flip()
不知道哪里错了,请各位帮忙看下