このコミットが含まれているのは:
2024-12-25 01:19:42 +09:00
コミット 50281f9120
2個のファイルの変更33行の追加20行の削除
サブモジュール nizika_ai が更新されました: 0dcc8656a1...9e136a7cb3
+18 -5
ファイルの表示
@@ -51,9 +51,8 @@ def main (
y = CWindow.HEIGHT - 120,
balloon = balloon)
CurrentTime (game, SYSTEM_FONT)
broadcast = Broadcast (os.environ['BROADCAST_CODE'])
try:
Sound ('assets/bgm.mp3').play (loops = -1)
broadcast = Broadcast (os.environ['BROADCAST_CODE'])
except Exception:
pass
while True:
@@ -62,6 +61,7 @@ def main (
pygame.quit ()
sys.exit ()
if not balloon.enabled:
try:
DB.begin_transaction ()
answer_flags = (AnsweredFlag.where ('platform', Platform.YOUTUBE.value)
.where ('answered', False)
@@ -76,6 +76,8 @@ def main (
answer_flag.save ()
DB.commit ()
add_query (broadcast)
except Exception:
pass
game.redraw ()
@@ -149,6 +151,7 @@ class Game:
sky (Sky): 天体情報
"""
bgm: Sound
clock: Clock
frame: int
last_answered_at: datetime
@@ -165,6 +168,9 @@ class Game:
self.clock = Clock ()
self.frame = 0
self.redrawers = []
self.bgm = Sound ('assets/bgm.mp3')
self.bgm.set_volume (.15)
self.bgm.play (loops = -1)
self._create_sky ()
def redraw (
@@ -257,6 +263,10 @@ class BgBase (GameObject):
surface (Surface): 背景 Surface
"""
bg: Surface
bg_evening: Surface
bg_grass: Surface
bg_night: Surface
surface: Surface
def __init__ (
@@ -264,8 +274,11 @@ class BgBase (GameObject):
game: Game,
):
super ().__init__ (game)
self.surface = pygame.image.load ('assets/bg.jpg')
self.surface = pygame.transform.scale (self.surface, (CWindow.WIDTH, CWindow.HEIGHT))
self.bg = pygame.image.load ('assets/bg.jpg')
self.bg_evening = pygame.image.load ('assets/bg-evening.jpg')
self.bg_grass = pygame.image.load ('assets/bg-grass.png')
self.bg_night = pygame.image.load ('assets/bg-night.jpg')
self.surface = pygame.transform.scale (self.bg, (CWindow.WIDTH, CWindow.HEIGHT))
def redraw (
self,
@@ -370,7 +383,7 @@ class Deerjika (Creature):
super ().redraw ()
if (not self.balloon.enabled) and self.talking:
self.talking = False
if (self.balloon.enabled and self.balloon.frame >= FPS * 3
if (self.balloon.enabled and self.balloon.frame >= FPS * 1.5
and not self.talking):
self.read_out ()