Ask coding questions

← Back to all posts
Having problem with ingame clock
Ryoto

I was creating an in-game clock where for every minute, an hour passes. This is the code:

class timeSpan:

class clock:
timer = timeSpan(1)
minutes = 0
hours = 0
days = 0
def tick:
if timer.ready():
minutes += 1
if not(minutes %= 60):
hours++
if not(hours %= 24):
days += 1

However, the computer said that datetime.datetime.now().totalSeconds()
was invalid syntax. Could you please help me with this problem?

Voters
Ryoto