vendredi 20 mars 2020

how can i delay the random choice repeatedly? [duplicate]

    global bullet
    global ball
    global ball_x
    pred1 = [bullet, ball]
    pred2 = random.choice(pred1)
    process = image(pred2, ball_x, 10)
time.sleep(0.5)

ball_x = [100, 200, 300]

I need to know how I can program the "process" to repeat itself after the "0.5" second and then sleep again for another "0.5" seconds and so on repeating this process forever.




Aucun commentaire:

Enregistrer un commentaire