Monster - a game programming language

Nicolay Korslund korslund at gmail.com
Sat Sep 8 08:47:46 PDT 2007


Daniel Keep Wrote:

> It's something borrowed from UnrealScript.  From what I remember, you
> could define blocks of code to be in a particular state, and then that
> code would only execute in that state.
> 
> Yes, you can do this with ifs and switches, but it's used so very often
> in games, it was promoted to a language feature.  Tim Sweeny's a damn
> smart cookie when it comes to these things.  With ZZT (released in
> 1991), it had an OO scripting language that used coroutines; the
> *editor* ended up being more popular than the game itself :P .

That is right. Having states as a language construct makes them much simpler and more intuitive to use. And one of the main benefits of the way states work in UScript (and will work in Monster) is that they can easily be added or changed through subclassing. The same functionality would quickly become cumbersome with ifs and switches.

- Nico



More information about the Digitalmars-d-announce mailing list