代码:
import pygame, sys
x = 640
y = 480
screen = pygame.display.set_mode([x,y], pygame.RESIZABLE | pygame.OPENGL)
while True:
x, y = pygame.Surface.get_size()
for event in pygame.event.get():
if event.type == pygame.QUIT or event.type == pygame.K_ESCAPE:
pygame.quit()
sys.exit()
错误
Traceback (most recent call last):
File "C:/Users/Mendel/My programs/game Project/test.py", line 8, in <module>
x, y = pygame.Surface.get_size()
TypeError: descriptor 'get_size' of 'pygame.Surface' object needs an argument
当我查找文档时,它说我应该没有错误