示例#1
0
    def __init__(self, position, create_asteroid_callback, size=3):
        self.create_asteroid_callback = create_asteroid_callback
        self.size = size

        size_to_scale = {3: 1.0, 2: 0.5, 1: 0.25}
        scale = size_to_scale[size]
        sprite = rotozoom(load_sprite("asteroid"), 0, scale)

        super().__init__(position, sprite, get_random_velocity(1, 3))
示例#2
0
    def __init__(self, position, create_asteroid_callback, size=3):
        self.create_asteroid_callback = create_asteroid_callback
        self.size = size

        size_to_scale = {
            3: 1,
            2: 0.5,
            1: 0.25,
        }
        scale = size_to_scale[size]
        sprite = rotozoom(load_sprite("happy-covid"), 0, scale)

        super().__init__(
            # Adjust Possible Asteroid Velocity Range: get_random_velocity(x, y)
            position, sprite, get_random_velocity(1, 3) # (1, 3)
        )
示例#3
0
 def __init__(self, position):
     super().__init__(
         position, load_sprite("asteroid"), get_random_velocity(1, 3)
     )