Pygame error: "module 'pygame' has no attribute 'get_ticks'"

246 Views Asked by At

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()

2

There are 2 best solutions below

0
Rabbid76 On

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()
0
Morris On

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.