オセロちょっと
このコミットが含まれているのは:
@@ -17,6 +17,7 @@ from aques import Aques
|
|||||||
from common_const import *
|
from common_const import *
|
||||||
from common_module import CommonModule
|
from common_module import CommonModule
|
||||||
from mode import Mode
|
from mode import Mode
|
||||||
|
from othello import Othello
|
||||||
from talk import Talk
|
from talk import Talk
|
||||||
from youtube import *
|
from youtube import *
|
||||||
|
|
||||||
@@ -47,6 +48,9 @@ class Main:
|
|||||||
screen: pygame.Surface = pygame.display.set_mode (
|
screen: pygame.Surface = pygame.display.set_mode (
|
||||||
(CWindow.WIDTH, CWindow.HEIGHT))
|
(CWindow.WIDTH, CWindow.HEIGHT))
|
||||||
|
|
||||||
|
# オセロ用オブジェクト
|
||||||
|
othello = Othello (screen)
|
||||||
|
|
||||||
# 吹き出し
|
# 吹き出し
|
||||||
balloon = pygame.transform.scale (pygame.image.load ('talking.png'),
|
balloon = pygame.transform.scale (pygame.image.load ('talking.png'),
|
||||||
(CWindow.WIDTH, 384))
|
(CWindow.WIDTH, 384))
|
||||||
|
|||||||
+13
-21
@@ -2,31 +2,23 @@ import pygame
|
|||||||
from pygame.locals import *
|
from pygame.locals import *
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from common_const import *
|
||||||
|
|
||||||
|
|
||||||
class Othello:
|
class Othello:
|
||||||
SCREEN_SIZE: tuple = (640, 480)
|
# 盤の色
|
||||||
|
|
||||||
BOARD_COLOUR: tuple = (0, 128, 0)
|
BOARD_COLOUR: tuple = (0, 128, 0)
|
||||||
|
|
||||||
@classmethod
|
def __init__ (
|
||||||
def main (cls) -> None:
|
self,
|
||||||
pygame.init ()
|
screen: pygame.Surface) \
|
||||||
screen: pygame.Surface = pygame.display.set_mode (cls.SCREEN_SIZE)
|
-> None:
|
||||||
|
self.screen = screen
|
||||||
|
|
||||||
while True:
|
# オセロ中?
|
||||||
screen.fill ((0, 0, 0))
|
self.othello_mode = False
|
||||||
|
|
||||||
# pygame.draw.rect (screen, BOARD_COLOUR, )
|
def redraw (self) -> None:
|
||||||
|
if self.othello_mode:
|
||||||
pygame.display.update ()
|
pass
|
||||||
pygame.time.wait (33)
|
|
||||||
|
|
||||||
for event in pygame.event.get ():
|
|
||||||
if event.type == QUIT:
|
|
||||||
pygame.quit ()
|
|
||||||
sys.exit ()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
Othello.main ()
|
|
||||||
|
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする