samedi 16 mai 2015

Randomly Spawning an Image

I created this function that randomly spawn a dot, but because its in my game loop the dot just does not stay where it is. I want it to spawn a dot and then wait 6 seconds and spawn another one randomly, but the first still being there. Because there is other things happening on the screen at the same time I cant use time.sleep(6). Any help solving this would be really appreciated.

    def random_spawn():
        image_x = random.randrange(122, 476)
        image_y = random.randrange(90, 350)
        screen.blit(Green, (image_x, image_y))




Aucun commentaire:

Enregistrer un commentaire