You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before calling pygame.display.update(hero.rect), the hero.rect in the previous frame position should be filled with background, otherwise once it is moved, all its previous positions still get rendered in the next display.update call.
Basically, the solution is explained here:
Blit a piece of the background over the sprite’s current location, erasing it.
Append the sprite’s current location rectangle to a list called dirty_rects.
Move the sprite.
Draw the sprite at it’s new location.
Append the sprite’s new location to my dirty_rects list.
Call display.update(dirty_rects)
The text was updated successfully, but these errors were encountered:
Before calling
pygame.display.update(hero.rect)
, thehero.rect
in the previous frame position should be filled with background, otherwise once it is moved, all its previous positions still get rendered in the nextdisplay.update
call.Basically, the solution is explained here:
The text was updated successfully, but these errors were encountered: