From: Atani <at...@at...> - 2005-11-21 07:15:02
|
On 11/20/2005, "Dan Potter" <ba...@al...> wrote: >Speaking of Object event handling, I never really discussed why that >was in there. :D It might be interesting... I have been meaning to ask you what you were thinking of doing with that stuff :) I am thinking it would be a good way to implement the Object notifications perhaps? >Basically in Marbol I got to the point where I was manually managing >all this really nasty time based code. The standard animations and >triggers weren't cutting it anymore because they were too fixed. What I am quickly getting to the point where the current animations/etc are not quite enough for Chain Reaction. I need a similar style of event handling. If I come up with anything that is reasonably decent I will promote it from CR into Tiki so others can use it as well. Something that might be useful is completing the Timeline classes which are in Tiki now, these could (based on docs) support the style of events that CR and Marbol needs. >I had in mind a system (eventually) where you can just instantiate a >bunch of objects, maybe even through XML and not C++ at all, and >connect up their slots and signals (think Qt and Obj-C/IB here). So >that's why some weird classes are derived from Object instead of RefCnt. Actually that would be a good idea to have somehow... I am not sure how we would go about doing game logic, unless you include lua into the mix. lua is not out of the question for a "game framework" which makes use of an "uncompiled" definition file. I can certainly see this as a good way to export the visible bits out of the code though. It would take a bit of work perhaps to integrate the callbacks, but that should be doable too, most everything, including animations and "side shows" can be done via the XML (using Slideshow and similar background effects). This could be a way to describe a lightbar menu: <scene> <background> <image>data/bg.png</image> <slideshow> <position x=3D"0.0" y=3D"0.0" z=3D"0.10" /> <content> <image>data/slide01.png</image> <image>data/slide02.png</image> <image>data/slide03.png</image> <image>data/slide04.png</image> <image>data/slide05.png</image> </content> </slideshow> </background> <lightbarMenu> <option id=3D"start">Start Game</option> <option id=3D"scores">High Scores</option> <option id=3D"quit">Quit</option> </lightbarMenu> </scene> Basically this could define a scene with a static background image (data/bg.png), a slideshow with 5 slides in it, and a simple lightbar menu with three options in it all having a unique id assigned in the XML. The id attribute values could be used as the "return value" from the scene. Of course this is only an example and does not contain enough attributes to be very useful. Mike |