I have a timer in a game I'm programming in python/pygame.
The timer works fine when I have everything in the main class:
time=50
seconds_passed = clock.tick()/1000.0
time-=seconds
draw_time=math.tranc(time)
print(draw_time)
However when I move this into a new class player
class player():
.
.
.
set_time(self, draw_time):
seconds_passed = clock.tick()/1000.0
time-=seconds_passed
draw_time=math.tranc(time)
print(draw_time)
When I call this function in the main class:
class main():
.
.
.
draw_time=20
player = Player()
print player.set_time(draw_time)
My time is not decrementing however stays the same!
Any suggestions?