Re: Object Oriented Programming in Maratis(LUA)(Tutorial)
Ah hell, i tought it was ok, but the problem's not gone -.-
I'm gonna make a detailed topic about it later today, because there's also other stuff that's not working correctly
You are not logged in. Please login or register.
Ah hell, i tought it was ok, but the problem's not gone -.-
I'm gonna make a detailed topic about it later today, because there's also other stuff that's not working correctly
I stumbled across something interesting when wondering if I can use a function as an argument:
http://stackoverflow.com/questions/1698
ter-in-lua
function init()
print("init");
end
block = {
startup = init
}
They also say the two examples below are the same:
function foo()
end
foo = function()
end
Last edited by Tutorial Doctor (2014-03-02 19:41:31)
joe = {name =nil, age =nil, gender =nil}
joe.name = "Joseph"
joe.age = "24"
joe.gender = "Male"
I am wondering if such code would work, and I am wondering if I could put functions into the table also to do simpler OOP.
function foo() end foo = function() end
in the Cryengine used to this style of programming.
also it is possible in javascript to write.
joe = {name =nil, age =nil, gender =nil}
joe.name = "Joseph"
joe.age = "24"
joe.gender = "Male"
what's special? Lua allows you to do much more interesting things!
Yeah, lua is looking more flexible every day. I think I need to learn some of the other languages alongside lua so I can actually see the flexibility of it.
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.