But i'm getting an error:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 16, in script
$ calendar.AddTime (1)
File "game/script.rpy", line 16, in <module>
$ calendar.AddTime (1)
AttributeError: 'tuple' object has no attribute 'AddTime'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 16, in script
$ calendar.AddTime (1)
File "E:\soft\renpy-7.3.5-sdk\renpy\ast.py", line 914, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "E:\soft\renpy-7.3.5-sdk\renpy\python.py", line 2028, in py_exec_bytecode
exec bytecode in globals, locals
File "game/script.rpy", line 16, in <module>
$ calendar.AddTime (1)
AttributeError: 'tuple' object has no attribute 'AddTime'
Windows-7-6.1.7601-SP1
Ren'Py 7.3.5.606
Chemist 1.0
Fri Jan 15 19:40:40 2021
Code: Select all
init python:
class Calendar(object):
def __init__(self, wd, d, h, m):
self.d = d
self.h = h
self.m = m
self.wd = wd
def AddTime (self, h):
self.h += h
if m > 59:
hadd, m = m%60
h += hadd
if h > 23:
h = h%24
return h,m
label lists:
$ calendar = Calendar (['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday','Sunday'], 1, 8, 0)
return
label start:
call lists
$ GameRunning = True
while GameRunning:
'qwe '
$ calendar = (3, 5, 6, 7)
$ calendar.AddTime (1)
"It is [h]:[m]"