幫我看下self.rect.top=randint(-5*self.height,0)這個什麼意思,不是很明白,謝謝
import pygame
from random import *
class Smallenemy(pygame.sprite.Sprite):
def init(self,bg_size):
pygame.sprite.Sprite.init(self)
self.image=pygame.load("images/enemy1.png".convert_alpha)
self.destroy_image=[]
self.destroy_image.extend([
pygame.image.load("images/enemy1_down1.png").convert_alpha(),
pygame.image.load("images/enemy1_down2.png").convert_alpha(),
pygame.image.load("images/enemy1_down3.png").convert_alpha(),
pygame.image.load("images/enemy1_down4.png").convert_alpha()
]) self.rect=self.image.get_rect() self.width=bg_size[0] self.height=bg_size[1] self.speed=2 self.active=True self.rect.left=randint(0,self.self.width-self.rect.width) self.rect.top=randint(-5*self.height,0)def move(self): if self.rect.top