import pygame, sys
from pygame.locals import *
white=(255,255,255)
black=(0,0,0)
green=(0,255,0)
pygame.init()
window=pygame.display.set_mode((740, 450),0,32)
image=pygame.image.load("Rogue.png")
image.set_colorkey(white)
x,y=0,0
movex,movey=0,0
while True:
window.fill(green)
for event in pygame.event.get():
if event.type==QUIT:
pygame.quit()
sys.exit()
if event.type==KEYDOWN:
if event.key==K_LEFT:
movex+=-1
elif event.key==K_RIGHT:
movex+=1
elif event.key==K_UP:
movey+=-1
elif event.key==K_DOWN:
movey+=1
x=movex
y=movey
window.blit(image,(x,y))
pygame.display.update()
每次我跑我的性格有一個難看的白色光環式的諸如此類的事情代碼一個奇怪的白色像素化邊界回事... 如果你可以嘗試一下,告訴我什麼這是錯誤的將是恆星! :D 這是Png:http://imgur.com/h2yZGfm And screenshot:http://imgur.com/wUUC8a6我的精靈周圍有
你可以加入一個截圖,以便我們看到手頭的問題嗎?也許可以上傳PNG,這樣我們就可以看到它應該是什麼樣子了。 – 2014-02-25 02:51:04