Example #1
0
    def update(self):
        self.y -= self.vel

        if self.sine:
            self.x += sin_osc(self.freq, -5, 5, self.osc_delay)

        if self.top < 0:
            self.alive = False

        for actor in game.ufos + game.bombs:
            if self.colliderect(actor):
                actor.hit()
                self.alive = False
                return
Example #2
0
 def draw(self):
     if self.shield:
         radius = round(sin_osc(0.5, 50, 60))
         screen.draw.circle(self.center, radius, 'white')
     super().draw()
Example #3
0
 def bg_color(self):
     r = sin_osc(0.05, 10, 30) + self.glow
     g = sin_osc(0.06, 0, 10) + self.glow / 2
     b = sin_osc(0.07, 50, 150) - self.glow
     return clip_rgb((r, g, b))
Example #4
0
 def draw(self):
     if self.shield:
         radius = sin_osc(0.5, 40, 50, self.osc_delay)
         screen.draw.circle(self.center, round(radius), 'white')
     super().draw()