From 65a9033a4bb0cabf3eab1d02abf59c01a5eaafe0 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Mon, 6 May 2024 23:58:43 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AA=E3=82=BB=E3=83=AD=E3=81=A1=E3=82=87?= =?UTF-8?q?=E3=81=A3=E3=81=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 ++++ othello.py | 56 +++++++++++++++++++++++------------------------------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/main.py b/main.py index f946f0c..f8896f4 100644 --- a/main.py +++ b/main.py @@ -17,6 +17,7 @@ from aques import Aques from common_const import * from common_module import CommonModule from mode import Mode +from othello import Othello from talk import Talk from youtube import * @@ -47,6 +48,9 @@ class Main: screen: pygame.Surface = pygame.display.set_mode ( (CWindow.WIDTH, CWindow.HEIGHT)) + # オセロ用オブジェクト + othello = Othello (screen) + # 吹き出し balloon = pygame.transform.scale (pygame.image.load ('talking.png'), (CWindow.WIDTH, 384)) diff --git a/othello.py b/othello.py index f60c105..f2654fa 100644 --- a/othello.py +++ b/othello.py @@ -1,32 +1,24 @@ -import pygame -from pygame.locals import * -import sys - - -class Othello: - SCREEN_SIZE: tuple = (640, 480) - - BOARD_COLOUR: tuple = (0, 128, 0) - - @classmethod - def main (cls) -> None: - pygame.init () - screen: pygame.Surface = pygame.display.set_mode (cls.SCREEN_SIZE) - - while True: - screen.fill ((0, 0, 0)) - - # pygame.draw.rect (screen, BOARD_COLOUR, ) - - pygame.display.update () - pygame.time.wait (33) - - for event in pygame.event.get (): - if event.type == QUIT: - pygame.quit () - sys.exit () - - -if __name__ == '__main__': - Othello.main () - +import pygame +from pygame.locals import * +import sys + +from common_const import * + + +class Othello: + # 盤の色 + BOARD_COLOUR: tuple = (0, 128, 0) + + def __init__ ( + self, + screen: pygame.Surface) \ + -> None: + self.screen = screen + + # オセロ中? + self.othello_mode = False + + def redraw (self) -> None: + if self.othello_mode: + pass +