Menu

Language design

Well at the moment, I'm finalising the language design. I've added a new feature that automates a global and object oriented event system. The keyword 'event' will register the enclosed function as an event by its name with attributes that can affect how and when its triggered. I'm mainly doing this for games since they are one of the most used elements in games.

Object based events will also be available. Some examples are below

<font color="green">-- global event with one parameter</font>
<font color="blue">event</font> enterFrame (<font color="blue">real</font> deltaTime)
{
<font color="green">-- code</font>
}

<font color="green">-- global event with no parameters but filtered by the boolean conditional in the if statement</font>
<font color="blue">event</font> enterFrame (<font color="blue">real</font> deltaTime) : <font color="blue">if</font> (isOddFrame == <font color="blue">true</font>)
{
<font color="green">-- code</font>
}

<font color="green">-- object event with no parameters. the 'this' keyword applies to the object instance triggering the event</font>
<font color="blue">event</font> enterFrame (<font color="blue">real</font> deltaTime) : <font color="blue">for</font> game.actor
{
<font color="blue">this</font>.moveTo (12, 4.5)
<font color="green">-- code</font>
}

Posted by Nicholas Bedford 2006-10-11

Log in to post a comment.

MongoDB Logo MongoDB