您將圖像閃爍到表面上以用作背景。然後按下按鈕X在同一表面上拍攝圖像,如何擦除圖像?到目前爲止,我有這個,但最後我在背景中間出現了一個白色的矩形。Pygame擦除背景上的圖像
screen = pygame.display.set_mode(1280, 512)
screen.blit(background, (0,0))
while True:
pygame.display.flip() #flip is same as update
for event in pygame.event.get():
if (event.type == pygame.KEYDOWN):
if event.key == pygame.K_SPACE:
screen.blit(player, (x, y))
if event.key == pygame.K_BACKSPACE:
pygame.draw.rect(screen, [255,255,255], (x, y, 62,62))
您提到了「添加精靈」。我看過這個詞很多。但是這是什麼意思?它僅僅是前景的東西,比背景還小? – Ray 2014-07-03 12:28:37
查看維基百科文章[這裏](http://en.wikipedia.org/wiki/Sprite_(computer_graphics)) – Appleman1234 2014-07-03 21:30:10