Browse Source

#31 き太移行完了

ai-migration
みてるぞ 1 month ago
parent
commit
65fe453426
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      test.py

+ 9
- 8
test.py View File

@@ -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 (


Loading…
Cancel
Save