[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A Question of Style
- From: HyperHacker <hyperhacker@...>
- Date: Mon, 28 Nov 2011 23:24:31 -0700
On Mon, Nov 28, 2011 at 23:08, Mark Hamburg <mark@grubmah.com> wrote:
> On Nov 28, 2011, at 9:48 PM, Henk Boom wrote:
>
>> Personally I would always prefer 1), and can't think of any advantages
>> for 2), other than being _slightly_ easier to implement in c.
>
> Easier documentation depending on the audience? Love2D at one time at least handled the standard entry points as global functions which probably made it easier to describe what a basic game looks like. Of course, by the time you do anything interesting, the registration code is a fraction of the complexity of the real work.
>
> Mark
>
>
On the subject of games, it's worth noting that there exists a third
approach, similar to interfaces from other languages: scripts register
an object (table) which contains functions with certain names to
handle events. I did this in a game engine: each actor can have
functions like OnContact, OnJumpPressed, etc that are called when the
event occurs.
--
Sent from my toaster.