Browse Source

#31 today sagefu-bun

ai-migration
みてるぞ 1 month ago
parent
commit
11195e5125
1 changed files with 19 additions and 1 deletions
  1. +19
    -1
      test.py

+ 19
- 1
test.py View File

@@ -1,5 +1,7 @@
from __future__ import annotations

from abc import ABCMeta, abstractmethod

import pygame


@@ -19,13 +21,29 @@ class Game:
self.clock = pygame.time.Clock ()


class Deerjika:
class GameObject (metaclass = ABCMeta):
def __init__ (
self,
game: Game,
):
self.game = game
self.redrawer.append (self.redraw)

@abstractmethod
def redraw (
self,
) -> None:
raise NotImplementedError ()


class Deerjika (GameObject):
def __init__ (
self,
game: Game,
pattern: DeerjikaPattern = DeerjikaPattern.NORMAL,
direction: Direction = Direction.LEFT,
):
super ().__init__ (self)
self.game = game
self.pattern = pattern
self.direction = direction


Loading…
Cancel
Save