コード例 #1
0
 def __init__(self, row, position):
     surface, rect = graphic(f'explosion{_IMG_COLORS[row]}', position)
     surface = transform.scale(surface, (40, 35))
     BasicSprite.__init__(self, surface, rect)
     self.start_time = 0
     self.row = row
     self.moved = False
コード例 #2
0
 def __init__(self, score, position):
     x, y = position
     surface, rect = text(str(score), SpaceInvadersColor.WHITE.value, *SpaceInvadersFont.SMALL.value,
                          position=(x + 20, y + 6))
     BasicSprite.__init__(self, surface, rect)
     self.start_time = 600
     self.row = MYSTERY_ROW
コード例 #3
0
 def __init__(self, position):
     surface, rect = graphic('ship', position)
     BasicSprite.__init__(self, surface, rect)
     self.start_time = 900