[Solved] Game States

Dirso

26-12-2006 19:50:07

Hi,

Did any of you ever used game states with OgreOde? Where should I create the "world"? What should derivate CollisionListener from?
Any help would be really appreciated.

Thanks a lot,
Dirso.

luis

28-12-2006 12:24:37

Where should I create the "world"?


i'm doing that in the "IntroState" initializing a singleton class that makes the "mWorld = new World", this class also instantiate some other classes too, it's a kind of "global instances holder". In that way i know exactly in wich order are created some inter-dependent classes.

What should derivate CollisionListener from?

I didn't reached this point yet (i'm still using what i found more easy) but i'm planning to make some thing like this:

class myWorld : public OgreOde::World, public OgreOde::CollisionListener
{
......
};



In myWorld class i have a map with all game objects created so there i could easly let them know which one is hitting them and fire effects like sound, particles, increment damage etc.

But i'm not really sure about this solution, if anyone knows a better way tell us please ;)