import pygame
DISPLAY_SIZE = (640, 480)
class SimpleGame:
def __init__(self, b_color = 'white'):
pygame.init()
self.screen = pygame.display.set_mode(DISPLAY_SIZE)
클래스 내부에서 변수이름만 써도 된다.
class SimpleGame:
DISPLAY_SIZE = (640, 480)
def __init__(self, b_color = 'white'):
pygame.init()
self.screen = pygame.display.set_mode(SimpleGame.DISPLAY_SIZE)
클래스이름.변수이름( = SimpleGame.DISPLAY_SIZE) 이렇게 써야 한다.