【发布时间】:2015-04-24 11:40:33
【问题描述】:
这是我的代码,我正在尝试制作一个矩形:
import pygame
import sys
pygame.init()
color = [255,20,78]
black = [0,0,0]
screen = pygame.display.set_mode((800,600), 0, 32)
pygame.display.set_caption("Rectangle")
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
screen.fill(color)
pygame.draw.rect(color, black, [400,300,10,10])
pygame.display.update()
我不明白这个错误对 Surface 意味着什么 有人可以帮帮我吗? 任何帮助表示赞赏! 哦,请不要对我发誓,我仍然是一个程序新手。 错误:
Traceback (most recent call last):
File "C:\Users\Hugo\Desktop\Pygame\game - kopie.py", line 15, in <module>
pygame.draw.rect(color, black, [400,300,10,10])
TypeError: must be pygame.Surface, not list
【问题讨论】: