Sunday, August 28, 2005

This weekend I have been mainly tinkering with Lua

... I also wanted to do some graphics stuff with the old engine but it hasn't come to pass. I know I'm stalling so I need to get on it.

My handy lua functions are

Maybe

Takes a function and chance[0-1] and may or may not run said function.

OneOf

Takes a list of function and randomly runs out of them.

This kind of stuff would be tricky in C#, its not too easy in Lua but it has nice first order functions so it's possible. I'll be using these functions all over the place to add variation to my game.

I also wrote the documentation first :D which is novel for me :) I did it in a natural docs style too as I like that commenting style. Although there's no native support for lua a config file seems pretty easy to set up. (I've yet to download the binary though, just adopted the style.)

No comments: