I am learnining pygame and I got error "module 'pygame' has no attribute 'get_ticks'". What do i have to do?
My code was: start_ticks = p.get_ticks()
Asked
Active
Viewed 168 times
0

Rabbid76
- 202,892
- 27
- 131
- 174

Yunwoo Chang
- 1
- 1
-
My code was: "start_ticks = p.get_ticks()" – Yunwoo Chang Oct 01 '22 at 11:59
-
where is the rest of the code ? https://stackoverflow.com/help/minimal-reproducible-example – D.L Oct 01 '22 at 13:32
2 Answers
0
There is no pygame.get_ticks()
. However, the pygame.time
module has a function pygame.time.get_ticks
:
import pygame as p
start_ticks = p.time.get_ticks()

Rabbid76
- 202,892
- 27
- 131
- 174
0
There is no such thing as pygame.get_ticks
but as Rabbid76 said pygame.time had get_ticks() so your code should be pygame.time.get_ticks()
that should work.

Morris
- 55
- 6