diff --git a/test.py b/test.py index a7d2703..24162a6 100644 --- a/test.py +++ b/test.py @@ -35,7 +35,10 @@ def main ( x = CWindow.WIDTH * 3 / 4, y = CWindow.HEIGHT - 120) balloon = Balloon (game) CurrentTime (game, SYSTEM_FONT) - Sound ('assets/bgm.mp3').play (loops = -1) + try: + Sound ('assets/bgm.mp3').play (loops = -1) + except Exception: + pass while True: for event in pygame.event.get (): if event.type == pygame.QUIT: @@ -388,19 +391,17 @@ class KitaSun (GameObject): def redraw ( self, ) -> None: + surface = pygame.transform.rotate (self.surface, -(90 + math.degrees (self.arg))) + self.game.screen.blit (surface, surface.get_rect (center = (self.x, self.y))) + super ().redraw () self.game.sky.observer.date = datetime.now () - timedelta (hours = 9) self.sun.compute (self.game.sky.observer) self.alt = self.sun.alt self.az = self.sun.az - print (self.x, self.y) - self.game.screen.blit ( - pygame.transform.rotate (self.surface, -(90 + math.degrees (self.arg))), - (self.x, self.y)) - super ().redraw () + if abs (self.new_arg - self.arg) > math.radians (15): + self.arg = self.new_arg self.x = self.new_x self.y = self.new_y - if abs (self.new_arg - self.arg) > math.radians (3): - self.arg = self.new_arg @property def new_x (