python - Collision issue in pygame -
here sample of code:
if not pygame.sprite.collide_rect(yolo,blocks): screen.blit(mooncollect, [randomlistx[i]-stagebackground_x, randomlisty[i]])
i have 2 sprites , right while collide, mooncollect disappears. how can fix logic mooncollect not appear during , after collision?
appreciate help, , tell me if being unclear.
thanks
you create variable represent if moon has ever collided object
ismoon = false if pygame.sprite.collide_rect(yolo,blocks): ismoon = true //when rendering if (ismoon == false): screen.blit(mooncollect, [randomlistx[i]-stagebackground_x, randomlisty[i]])
this way, when mooncollect not colliding object, in past has, not rendered.
Comments
Post a Comment