# Pygame Updating Display Without Being Told To

The following (abridged) bit of code is inside the main loop. What I expected to happen was the entity's position to update due to velocity, then update again if it's touching a static object before drawing rects and updating the display, but when run, an entity approaching a static will always visibly intersect with the static for one frame before moving back out, like it's running ent/stc.load() (a method for drawing rects) and pygame.display.update() multiple times during each loop.



pygame.Surface.fill(window,(100,0,0))
for stc in statics:
for ent in entities:
ent.vel[0]+=ent.acc[0]
ent.pos[0]+=ent.vel[0]
for stc in statics:
if ent.rect.colliderect(stc):
if ent.vel[0]>0:
ent.acc[0]=0
ent.vel[0]=0
ent.pos[0]=stc.rect.left-ent.box[0]
clock.tick(60)
pygame.display.update()

• which values the ent.box list contains? width and height? – 648trindade Aug 9 '19 at 15:44