455
« on: October 18, 2011, 12:21:09 pm »
As for the game logic stuff, it is designed to be all kept in a scene graph.
Every object of your game can and should be integrated in the scene graph, either as a proper node, or as a node's member variable.
This way, you keep a high level of flexibility and logic,and when something needs to be closed, when nothing is using it anymore, it will be able to destroy itself, with custom destruction code for your nodes.
For example, you have your game like this:
SceneRoot -> CustomNodeToHoldStuff
-> WorldMap1 -> Layer1
-> Layer2
There are nodes which have a clear purpose, while you can create other nodes that you use as placeholders for organization purposes.
An example of employing the power of such structure.. Imagine that WorldMap1 is a full featured side view map, with physics and so on, it is normally rendered full screen (as the default sfml view). If you suddenly feel like you want your map rendered in a little frame somewhere in your screen, you just add a SceneCamera configured for that frame, as the WorldMap1 parent, and it imediatly becomes affected, so that all children to the camera suffer from that view, and then it returns back to the previous view.
This concepts are still under progress, the engine base is there, but now I need to prove the design i have planned with demonstrations etc, improving along the way, and even adding stuff (not all of this is 100% working yet)