A quick question on flow...

Hi all,

I have come from programming with sub routines etc and have just spent the last week learning the basics of python to give this engine a go.

I have gone through the code in the tutorials and have one quick question - how do you reset a program in Panda3d? The tutorials all exit on escape and have all the movements / changes inside the world class. But say I was running a racing type program and after the race wanted to reset the data and run another race with user input - am I right in thinking I need to have some sort of change data function in that class that will reset everything etc before returning to run()?

Hope that makes sense and doesn’t sound too noobish

Regards

Edit Update:

Ok I have been reading more and was wondering if this could be achieved by:

A. a complete reset by reseting / deleting and creating a new instance of the class

B. or if I wanted to keep some already loaded objects, sounds, textures etc then a function in the class that hides the 3d environment and shows the 2d interface, updates the 3d environment and then hides the 2d environment and shows the 3d environment again

You can do both.

For example, lets say I set up a race care class, which loads a model and the like. I define a function called reset, that when called sets the care to the start position.

I have a simular class on all other objects, and call them all when the race ends.

Thank you.

I also noted in the solar system tutorial that the init function calls a number of other functions to set the scene much like other programming languages would call sub routines.

I think I understand the flow of Panda3d and Python better now.

Cheers