我正在尝试在矩形上快速显示图像。
这是我创建矩形的函数。在def drawCell(coords,ccolor):
#Here coords is the coordnnates (x and y axis) for rectangle
#cclor is colour for the rectangle , white in my program.
global score
for coord in coords:
x=coord['x']*cellSize
y=coord['y']*cellSize
makeCell=pygame.Rect(x,y,cellSize,cellSize)
pygame.draw.rect(gameDisplay,ccolor,makeCell)
if makeCell.colliderect(foodrect): #If the rectangle collides with food
#score gets added and the food is blitted
#to a random
foodrect.x = random.randint(0, display_width-25)
foodrect.y = random.randint(0, display_height-25)
score+=1
scoredisplay(score) #Displays Score
这是游戏循环中的函数调用:
^{pr2}$
现在我想让它做的是在矩形上的一个blitthis,这样看起来苹果在移动(move函数是不同的,这里没有提供)。在