Game engines..


I don’t know enough Blender Game Engine API, so my question is oriented to it.

Python, I have a basic knowledge of it, but at the same time I’m studying Panda 3D.

Here is my short story: At the beginning i was thinking in blender game engine as a totally graphical interface game designer, but since it uses python, there are a large parts of contents that can perform enhancement in the result of the game. But a root script is need to order all about your game, and when i was thinking in make a game in blender, a question came to my mind : " Without a root script, how do I will arrange the objects if something occurr, how do I declare conditions without scripting?, and how can i declare if the player pass over a ramp the world ambient changes sudenly ?, logically that is a lot easiest scripting, but graphically I think is a bit difficult…

But then think, Blender has API, so you can write a script with class and functions, for example:

Pseudocode of Root’s Script (The main script that aim to everything)

class world:
   function __initialize__(self):
              environment1 = load a mesh object ("./meshes/world.blend")
              environment2 = load a mesh object ("./meshes/world2.blend")
              scale the environment to 3
              door5 = load a mesh object ("./meshes/kitchen.blend")
              player = load a mesh object ("./meshes/player.blend")

   function actions(self):
              if player touchs door5:
                       load environment2
                       player.setPosition (in front of door to the environment1)
              elif player not touchs door5:

The code is just an example :), i search the way to merge scenes or blends all called from one root script… the idea is that you control everething with the root script…
This is the way that Panda 3D, Python-Ogre, Irrlicht and others engine use, we know that Blender is mainly graphical, but it must has a system like those…

I tell you this, because, i was doing an horror silent hill style game 1 year ago totally in blender, but when i touch a door with the player and press a button, it loaded the next space correctly, but setting the position of player was the problem, if you crossover a door, in the next scene you logically must to stay in front of the door, not in the center of the room, so, what happend if that room has 3 or 4 or more doors?, how can i tell to game engine that i want to load the next space with the player located in front of door,… yeah!! with setPosition !, but where do you declare it?? root script.!!!

Someone know how to script like this?, uning single meshes, calling them apart.

Thanks in advance.