![]() |
|
#2
|
|||
|
|||
|
There seems to be a problem with your current code. The while loop inside your game task is not yielding. This will probably cause the graphics loop to freeze. It seems like there should be a yield None statement at the end of the loop.
Regarding your original question. You can setup a simple callback function that restarts the game task when the 'r' key is pressed. Example: Code:
def ResetGame():
global myTask
myTask.kill() # Kill existing task
myTask = viztask.schedule( game() ) # Create new game task
vizact.onkeydown('r',ResetGame)
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 11:13 AM |
| General question and question regarding arrays | dan12345 | Vizard | 1 | 01-15-2008 10:15 AM |
| python 2.4 instead of 2.3? | perselletje | Vizard | 7 | 03-14-2006 11:06 AM |
| Extending Python With C++ | Vygreif | Vizard | 2 | 01-18-2006 09:21 AM |
| Use Vizard 2.5 with Python 2.4.1 / IDLE 1.1.1 | Gilliard | Vizard | 4 | 08-04-2005 11:49 PM |