0
所以我在pygame中的精灵都具有相同的碰撞效果,即使你我把它们分成不同的defs你知道我该如何解决这个问题吗?PyGame雪碧冲突冲突
def render(self,collisionrock):
if (collisionrock==True):
pygame.draw.rect(window,red,(150,150,100,100)) #for some reason this wont work
window.blit(self.i1, (self.x,self.y))
def render(self,collisionguy):
if (collisionguy==True):
font = pygame.font.Font(None, 50)
text = font.render("YOU WIN", 1, (10, 10, 10)) #they would all apply this line
textpos = text.get_rect() #of code
textpos.centerx = window.get_rect().centerx
window.blit(text, textpos)
window.blit(self.i1, (self.x,self.y))
else:
window.blit(self.i1, (self.x,self.y))
C++重载在Python中不起作用 – volcano