Skip to content
Sign upLog in

Loops

Profile icon
MATTHEWBECHTEL

Does anyone now how to loop something?

You are viewing a single comment. View All
Answered by ArchieMaclean [earned 5 cycles]
View Answer
Profile icon
MATTHEWBECHTEL

Ok umm also is there a way to use Time.Sleep(1) but with a decimal as an time interval? For example: Time.Sleep(1.65) It would be super useful.

Profile icon
Geocube101

@MATTHEWBECHTEL
It should work just as you typed it. Is it not working?

If not, try a lowercase 'T': time.sleep(value)

Profile icon
MATTHEWBECHTEL

No it is, but I’m just wondering if decimals work in time.sleep

@Geocube101
like time.sleep(.89)

Profile icon
ArchieMaclean

@MATTHEWBECHTEL
I think decimals work. Try it and see! If not,

import pygame pygame.time.wait(10) # waits 10 ms

may work (not sure if it works on just python repls though)

Profile icon
MATTHEWBECHTEL

Yes, I just realized that they work! Thank you.

@ArchieMaclean