本日作業分
このコミットが含まれているのは:
@@ -91,6 +91,7 @@ class Main:
|
|||||||
# 大月ヨヨコ
|
# 大月ヨヨコ
|
||||||
jojoko: pygame.Surface = pygame.transform.scale (
|
jojoko: pygame.Surface = pygame.transform.scale (
|
||||||
pygame.image.load ('moon.png'), (200, 200))
|
pygame.image.load ('moon.png'), (200, 200))
|
||||||
|
jojoko.set_colorkey (pygame.Color (0, 255, 0))
|
||||||
|
|
||||||
# 音声再生器の初期化
|
# 音声再生器の初期化
|
||||||
pygame.mixer.init (frequency = 44100)
|
pygame.mixer.init (frequency = 44100)
|
||||||
@@ -119,7 +120,7 @@ class Main:
|
|||||||
# Youtube Chat から取得したコメントたち
|
# Youtube Chat から取得したコメントたち
|
||||||
chat_items: list = []
|
chat_items: list = []
|
||||||
|
|
||||||
# 会話の履歴(3 件分保持)
|
# 会話の履歴
|
||||||
histories: list = []
|
histories: list = []
|
||||||
|
|
||||||
while (True):
|
while (True):
|
||||||
@@ -142,24 +143,25 @@ class Main:
|
|||||||
# 日の入終了
|
# 日の入終了
|
||||||
sunset_end: datetime = sunset_start + timedelta (hours = 1)
|
sunset_end: datetime = sunset_start + timedelta (hours = 1)
|
||||||
|
|
||||||
# 月の出開始
|
# 時刻つき観測地
|
||||||
'todo'
|
|
||||||
|
|
||||||
# 月の出終了
|
|
||||||
'todo'
|
|
||||||
|
|
||||||
# 月の入開始
|
|
||||||
'todo'
|
|
||||||
|
|
||||||
# 月の入終了
|
|
||||||
'todo'
|
|
||||||
|
|
||||||
# 日の角度
|
|
||||||
observer_with_time: ephem.Observer = observer
|
observer_with_time: ephem.Observer = observer
|
||||||
observer_with_time.date = datetime.now () - timedelta (hours = 9)
|
observer_with_time.date = datetime.now () - timedelta (hours = 9)
|
||||||
|
|
||||||
|
# 日の角度
|
||||||
sun.compute (observer_with_time)
|
sun.compute (observer_with_time)
|
||||||
sun_alt: float = CommonModule.rad_to_deg (sun.alt)
|
sun_alt: float = CommonModule.rad_to_deg (sun.alt)
|
||||||
|
|
||||||
|
# 月の角度
|
||||||
|
moon.compute (observer_with_time)
|
||||||
|
moon_alt: float = CommonModule.rad_to_deg (moon.alt)
|
||||||
|
|
||||||
|
# 月齢
|
||||||
|
new_moon_dt: datetime = ephem.localtime (
|
||||||
|
ephem.previous_new_moon (observer_with_time.date))
|
||||||
|
moon_days_old: float = (
|
||||||
|
(datetime.now () - new_moon_dt).total_seconds ()
|
||||||
|
/ 60 / 60 / 24)
|
||||||
|
|
||||||
# 背景描画
|
# 背景描画
|
||||||
cls.draw_bg (screen, bg_day, bg_evening, bg_night, bg_grass,
|
cls.draw_bg (screen, bg_day, bg_evening, bg_night, bg_grass,
|
||||||
kita, jojoko,
|
kita, jojoko,
|
||||||
@@ -326,7 +328,7 @@ class Main:
|
|||||||
bg_night: pygame.Surface,
|
bg_night: pygame.Surface,
|
||||||
bg_grass: pygame.Surface,
|
bg_grass: pygame.Surface,
|
||||||
kita: pygame.Surface,
|
kita: pygame.Surface,
|
||||||
jojoko: pygame.Surface,
|
jojoko_original: pygame.Surface,
|
||||||
sunrise_start: datetime,
|
sunrise_start: datetime,
|
||||||
sunrise_end: datetime,
|
sunrise_end: datetime,
|
||||||
sunset_start: datetime,
|
sunset_start: datetime,
|
||||||
@@ -338,6 +340,8 @@ class Main:
|
|||||||
sunset_centre: datetime = (
|
sunset_centre: datetime = (
|
||||||
sunset_start + (sunset_end - sunset_start) / 2)
|
sunset_start + (sunset_end - sunset_start) / 2)
|
||||||
|
|
||||||
|
jojoko: pygame.Surface = jojoko_original.copy ()
|
||||||
|
|
||||||
dt: datetime = datetime.now ()
|
dt: datetime = datetime.now ()
|
||||||
|
|
||||||
if sunrise_centre <= dt < sunset_centre:
|
if sunrise_centre <= dt < sunset_centre:
|
||||||
@@ -356,6 +360,9 @@ class Main:
|
|||||||
|
|
||||||
screen.blit (bg_evening, (0, 0))
|
screen.blit (bg_evening, (0, 0))
|
||||||
|
|
||||||
|
# TODO: 緑を塗ってヨヨコを缺かす.
|
||||||
|
# pygame.draw.arc (jojoko, (0, 255, 0),
|
||||||
|
|
||||||
if -10 <= sun_alt < 40:
|
if -10 <= sun_alt < 40:
|
||||||
y = ((CWindow.HEIGHT / 2 + 100)
|
y = ((CWindow.HEIGHT / 2 + 100)
|
||||||
- (CWindow.HEIGHT / 2 + 200) / 30 * sun_alt)
|
- (CWindow.HEIGHT / 2 + 200) / 30 * sun_alt)
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする