关于python的游戏《兔子和獾》代码写到用键盘输入WASD控制兔子移动时,兔子移动不了。但是用了旋转的代码后,兔子可以随着鼠标旋转,就是不能移动。为何?
import pygame
import math
from pygame.locals import *
pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode((width, height))
keys = [False, False, False, False]
playerpos=[100,100]
acc=[0,0]arrows=[]
player = pygame.image.load("resources//images//dude.png")
grass = pygame.image.load("resources/images/grass.png")
castle = pygame.image.load("resources/images/castle.png")
arrow = pygame.image.load("resources/images/bullet.png")
while 1:
screen.fill(0)
for x in range(width/grass.get_width()+1):
for y in range(height/grass.get_height()+1):
screen.blit(grass,(x*100,y*100))
screen.blit(castle,(0,30))
screen.blit(castle,(0,135))
<