lua-users home
lua-l archive

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


On Mon, Aug 25, 2003 at 02:33:22PM -0300, Jose Marin wrote:
> Object{
>  
>   name = "object1",
>   flags = F_MONSTER,
>  
>   itens = { 
>        skill_easy = { item1, item2 },
>        skill_normal = { item3, item4 },
>        skill_hard = { item4, item5 },
> } 
>  
> }
>  
>  
> Object is a function.
>  
> I'll have dozens (almost hundreds) of objects like this.
>  
> Is there som better way of do this? O Lua manges efficiently the memory?

Looks fine to me. I shouldn't worry... unless, perhaps, your game is
intended to run on an embedded platform with 64K memory or some
similar thing.

For reference, one way to improve memory usage yourself is to use
userdata and manage the memory in C. A simple way of doing this is to
use tolua and C structs. But I don't believe this is necessary for
your example.

Jules