![]() |
|
|
|
#1
|
|||
|
|||
|
Just register the timer in your keyboard callback:
Code:
def timer1():
print 'Elapsed time:',viz.elapsed(), 'seconds'
def onkeydown(key):
if key == ' ':
quad.add(MovingRoom)
vizact.ontimer(60,timer1)
|
|
#2
|
|||
|
|||
|
I tried exactly that. That was my first thought, but I got this error message:
Traceback (most recent call last): File "<string>", line 2, in ? File "MOVING ROOM (FINAL).py", line 61 vizact.ontimer(60,timer1) ^ SyntaxError: invalid syntax So that's why I'm stuck |
|
#3
|
|||
|
|||
|
That means the indentation on that block of code is inconsistent. Select the entire block of code in Vizard then press Alt-T to tabify the region. Vizard 3.0 will display squiggly lines on lines of code with inconsistent indentation. I would suggest upgrading if possible.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|