|
|
@@ -29,10 +29,8 @@ DEERJIKA_FONT = pygame.font.SysFont ('07nikumarufont', 50) |
|
|
|
def main ( |
|
|
|
) -> None: |
|
|
|
game = Game () |
|
|
|
bg = Bg (game) |
|
|
|
KitaSun (game) |
|
|
|
deerjika = Deerjika (game, DeerjikaPattern.RELAXED, |
|
|
|
x = CWindow.WIDTH * 3 / 4, y = CWindow.HEIGHT - 120) |
|
|
|
Bg (game) |
|
|
|
Deerjika (game, DeerjikaPattern.RELAXED, x = CWindow.WIDTH * 3 / 4, y = CWindow.HEIGHT - 120) |
|
|
|
balloon = Balloon (game) |
|
|
|
CurrentTime (game, SYSTEM_FONT) |
|
|
|
try: |
|
|
@@ -47,6 +45,32 @@ def main ( |
|
|
|
game.redraw () |
|
|
|
|
|
|
|
|
|
|
|
class Bg: |
|
|
|
""" |
|
|
|
背景オブゼクト管理用クラス |
|
|
|
|
|
|
|
Attributes: |
|
|
|
base (BgBase): 最背面 |
|
|
|
grass (BgGrass): 草原部分 |
|
|
|
jojoko (Jojoko): 大月ヨヨコ |
|
|
|
kita (KitaSun): き太く陽 |
|
|
|
""" |
|
|
|
|
|
|
|
base: BgBase |
|
|
|
grass: BgGrass |
|
|
|
jojoko: Jojoko |
|
|
|
kita: KitaSun |
|
|
|
|
|
|
|
def __init__ ( |
|
|
|
self, |
|
|
|
game: Game, |
|
|
|
): |
|
|
|
self.base = BgBase (game) |
|
|
|
self.jojoko = Jojoko (game) |
|
|
|
self.kita = KitaSun (game) |
|
|
|
self.grass = BgGrass (game) |
|
|
|
|
|
|
|
|
|
|
|
class DeerjikaPattern (Enum): |
|
|
|
""" |
|
|
|
ニジカの状態 |
|
|
@@ -55,11 +79,13 @@ class DeerjikaPattern (Enum): |
|
|
|
NORMAL: 通常 |
|
|
|
RELAXED: 足パタパタ |
|
|
|
SLEEPING: 寝ニジカ |
|
|
|
DANCING: ダンシング・ニジカ |
|
|
|
""" |
|
|
|
|
|
|
|
NORMAL = auto () |
|
|
|
RELAXED = auto () |
|
|
|
SLEEPING = auto () |
|
|
|
DANCING = auto () |
|
|
|
|
|
|
|
|
|
|
|
class Direction (Enum): |
|
|
@@ -84,6 +110,7 @@ class Game: |
|
|
|
frame (int): フレーム・カウンタ |
|
|
|
redrawers (list[Redrawer]): 再描画するクラスのリスト |
|
|
|
screen (Surface): 基底スクリーン |
|
|
|
sky (Sky): 天体情報 |
|
|
|
""" |
|
|
|
|
|
|
|
clock: Clock |
|
|
@@ -182,7 +209,7 @@ class GameObject: |
|
|
|
self.frame += 1 |
|
|
|
|
|
|
|
|
|
|
|
class Bg (GameObject): |
|
|
|
class BgBase (GameObject): |
|
|
|
""" |
|
|
|
背景 |
|
|
|
|
|
|
@@ -207,6 +234,32 @@ class Bg (GameObject): |
|
|
|
super ().redraw () |
|
|
|
|
|
|
|
|
|
|
|
class BgGrass (GameObject): |
|
|
|
""" |
|
|
|
背景の草原部分 |
|
|
|
|
|
|
|
Attributes: |
|
|
|
surface (Surface): 草原 Surface |
|
|
|
""" |
|
|
|
|
|
|
|
surface: Surface |
|
|
|
|
|
|
|
def __init__ ( |
|
|
|
self, |
|
|
|
game: Game, |
|
|
|
): |
|
|
|
super ().__init__ (game) |
|
|
|
self.game = game |
|
|
|
self.surface = pygame.image.load ('assets/bg-grass.png') |
|
|
|
self.surface = pygame.transform.scale (self.surface, (CWindow.WIDTH, CWindow.HEIGHT)) |
|
|
|
|
|
|
|
def redraw ( |
|
|
|
self, |
|
|
|
) -> None: |
|
|
|
self.game.screen.blit (self.surface, (self.x, self.y)) |
|
|
|
super ().redraw () |
|
|
|
|
|
|
|
|
|
|
|
class Deerjika (GameObject): |
|
|
|
""" |
|
|
|
伊地知ニジカ |
|
|
@@ -436,6 +489,7 @@ class Jojoko (GameObject): |
|
|
|
|
|
|
|
def __init__ ( |
|
|
|
self, |
|
|
|
game: Game, |
|
|
|
): |
|
|
|
... |
|
|
|
|
|
|
|