lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello

I'm looking for someone to review some code I've done. It is about the concepts I'm using. I'm new to Lua, so I might be missing some important ideas. I read the manual and the book and tried a lot of the concepts described in the book. But I think an experienced user could easily review my code and give some advices. (Since it is not much code and I tried to keep it simple) Please mail me and I'll send you my code.

About my project:

I had this idea for a text adventure. I wanted to keep it simple, but have the possibility to display pictures instead of descriptions and play sound when the story is done.

So at the moment I write the adventure to run on Lua stand-alone. I tried different shades of object-orientation. (Found in the manuals, the book and the wiki) In the end I decided to do something in the middle. I use an object-based approach, so no classes, but multiple inheritance and privacy. Since classes won't suit an adventure well, because we deal with single specialized objects. (BTW I didn't find an easy way to have classes and privacy, but that’s another story). I don't use metatables to do the lookup; I copy the methods from parents to the child. Each parent initializes its public attributes on the child, which allows to do more complex data-structures without having to worry about deep-copy or copy constructors.

So please have a look at my code, since there is more than I described above. If the review discovers something of public interest, I'll post it here or in the wiki.

Best,
	Hans Fuchs