0
if(i%25==0):
        obstacle_add=int(random.randint(210,690))
        obstacle_list_ycord.append(obstacle_add)
        obstacle_list_xcord.append(1466)
        i=0
        for obstacle_index in range (10):
            pygame.draw.rect(win,(255,0,0),(obstacle_list_xcord[obstacle_index]-50,obstacle_list_ycord[obstacle_index],4,20))
            pygame.display.flip()
        obstacle_list_ycord.pop(0)
        obstacle_list_xcord.pop(0)

    i=i+1
    draw_obj()

I'm unable to see any objects being made on my fullscreen pygame module with no signs of errors in the shell.

This code is just a part of my 300 line putting which will make confusions. and the above code is already present in a loop so that is not the place of error.

martineau
  • 119,623
  • 25
  • 170
  • 301
pynigg
  • 1
  • 1
  • 2
    You should only call `display.flip()` once, after drawing all of the obstacles. – martineau Jan 24 '20 at 19:11
  • first check `print( i%25==0 )` to see if you ever get `True` for this. You may have wrong indentation and you update `i=i+1` inside `if i%25==0` so it is never updated. And you use `i=0` so finally you always get `i=0+1` – furas Jan 25 '20 at 03:12
  • yes i have tried printing 25 whenever the command activates. plus it becomes 0 only when it becomes 25. – pynigg Jan 25 '20 at 06:49

0 Answers0