yoshi
28-06-2006 13:23:02
Hi,
I'm a pyogre beginner and I was wondering how to change scene in my game. I've created two scenes, one with a dragon in the middle of space, and the other with a dragon with a 90 degrees yaw rotation:
This code opens the first Scene correctly. Now I want to change the scene to Scene2 (For example when the user presses 'C' key), but I don't know how to do..
Thanks in advance
I'm a pyogre beginner and I was wondering how to change scene in my game. I've created two scenes, one with a dragon in the middle of space, and the other with a dragon with a 90 degrees yaw rotation:
from pyogre import ogre
import SampleFramework
class Scene1(SampleFramework.Application):
def _createScene(self):
ent = self.sceneManager.createEntity("Dragon1","dragon.mesh")
node = self.sceneManager.rootSceneNode.createChildSceneNode("Dragon1 Node")
node.attachObject(ent)
class Scene2(SampleFramework.Application):
def _createScene(self):
ent = self.sceneManager.createEntity("Dragon2","dragon.mesh")
node = self.sceneManager.rootSceneNode.createChildSceneNode("Dragon2 Node")
node.attachObject(ent)
node.yaw(ogre.Degree(90))
if __name__ == "__main__":
Scene1 = Scene1()
Scene1.go()
This code opens the first Scene correctly. Now I want to change the scene to Scene2 (For example when the user presses 'C' key), but I don't know how to do..
Thanks in advance
