|
@@ -35,7 +35,10 @@ def main ( |
|
|
x = CWindow.WIDTH * 3 / 4, y = CWindow.HEIGHT - 120) |
|
|
x = CWindow.WIDTH * 3 / 4, y = CWindow.HEIGHT - 120) |
|
|
balloon = Balloon (game) |
|
|
balloon = Balloon (game) |
|
|
CurrentTime (game, SYSTEM_FONT) |
|
|
CurrentTime (game, SYSTEM_FONT) |
|
|
Sound ('assets/bgm.mp3').play (loops = -1) |
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
Sound ('assets/bgm.mp3').play (loops = -1) |
|
|
|
|
|
except Exception: |
|
|
|
|
|
pass |
|
|
while True: |
|
|
while True: |
|
|
for event in pygame.event.get (): |
|
|
for event in pygame.event.get (): |
|
|
if event.type == pygame.QUIT: |
|
|
if event.type == pygame.QUIT: |
|
@@ -388,19 +391,17 @@ class KitaSun (GameObject): |
|
|
def redraw ( |
|
|
def redraw ( |
|
|
self, |
|
|
self, |
|
|
) -> None: |
|
|
) -> 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.game.sky.observer.date = datetime.now () - timedelta (hours = 9) |
|
|
self.sun.compute (self.game.sky.observer) |
|
|
self.sun.compute (self.game.sky.observer) |
|
|
self.alt = self.sun.alt |
|
|
self.alt = self.sun.alt |
|
|
self.az = self.sun.az |
|
|
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.x = self.new_x |
|
|
self.y = self.new_y |
|
|
self.y = self.new_y |
|
|
if abs (self.new_arg - self.arg) > math.radians (3): |
|
|
|
|
|
self.arg = self.new_arg |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def new_x ( |
|
|
def new_x ( |
|
|