Skip to content

14 days of Akaldiroka – Day 2

August 9, 2011
by

After spending a short while considering weather or not to have an seporate Entity property in the Scene class for the level mesh, I realised that it will always be better to host these in the entity manager it’s self, theres no guarantee that a level will just be one big mesh, so allowing the entity manager to deal with that dynamic, means that there won’t be a jumbled mess in the scripts working out weather to probe the entity manager or something else… what was i thinking lol!

On a side-note, I’ve added a constructor for the Scene objects so that scripts associated with a Scene can be loaded in-line.

Just had a breakthrough, after playing with the idea of allowing seporate definable scripts to handle their own render events, I finally found a model that works. From now on, if a script file wishes to handle a scene’s events, it must declare an overriding class named ajsCurrentScene, and provide internal functions OnFramePrepare and OnFrameRender. As this conforms to the engine’s state model, it is ideal for giving the script a true object orientated environment, and to be honest has left me relieved, and a bit more confident in the choice we made to use the JavaScript engine in the first place.

Note to self, as scene’s now use this model, it makes sense to only have a constructor that accepts a scene javascript definition file.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: