Search found 211 matches

by Xgoff
Mon Jun 17, 2013 3:54 pm
Forum: Support and Development
Topic: Is there a point to getters and setters in Lua?
Replies: 15
Views: 11386

Re: Is there a point to getters and setters in Lua?

"basic" getters/setters seem kind of pointless imo, at least in a language where you can intercept field access. usually if i want something like this and i'm not being lazy, i'd rather implement attributes/properties/whatever they're called this week... ok so they're still getters/setters...
by Xgoff
Sun Jun 16, 2013 6:55 pm
Forum: Support and Development
Topic: Game Obfuscation
Replies: 38
Views: 15440

Re: Game Obfuscation

A better way would be to compile to lua bytecode. There is no good decompiler out there. Actually there are a few working decompilers out there. I've personally used one very successfully. Bytecode generated by regular Lua will not be compatible with different Lua versions (e.g. LuaJIT) or differen...
by Xgoff
Sun Jun 09, 2013 4:56 pm
Forum: Support and Development
Topic: Why Sin , Cos in 2d game dev?
Replies: 17
Views: 7109

Re: Why Sin , Cos in 2d game dev?

Remember, kids, premature optimization is bad. In this case, either Inny's or Jasoco's version is fine. Table lookups are unlikely to be a bottleneck, especially in simple games like the above would be a part of. Ignorance is bliss? This is not premature optimization, it's good lua coding habits. Y...
by Xgoff
Thu Apr 25, 2013 1:09 am
Forum: General
Topic: What makes a popular game?
Replies: 16
Views: 9161

Re: What makes a popular game?

space marines
by Xgoff
Mon Apr 15, 2013 1:56 am
Forum: General
Topic: Can't find huge memory leak [solved]
Replies: 7
Views: 4432

Re: Can't find huge memory leak

I'm starting to think the problem is that I've misunderstood the value returned by collectgarbage("count"). Now I think my game is only using a few hundred kilobytes not a few hundred megabytes. According to Lua 5.1 Reference "LUA_GCCOUNT: returns the current amount of memory (in Kby...
by Xgoff
Mon Apr 08, 2013 1:07 am
Forum: Support and Development
Topic: inexplicable slowdown in draw loop
Replies: 5
Views: 5652

Re: inexplicable slowdown in draw loop

i'd make sure your graphics drivers are updated, just to rule that out.

other than that, there's nothing immediately obvious as to what would cause that much slowdown. i'd watch your variable usage in the land.lua file; you have a ton of globals that probably should go into the land table instead
by Xgoff
Mon Apr 01, 2013 3:04 pm
Forum: Support and Development
Topic: executing function from argument
Replies: 12
Views: 3473

Re: executing function from argument

Another option is to put the arguments in a table and use unpack, like so: function foo(...) local args = {...} return function() print(unpack(args)) end end bar = foo('baz') bar() --> 'baz' However, this is problematic when two or more of the arguments are nil. The anonymous function really is the...
by Xgoff
Sun Mar 31, 2013 3:11 pm
Forum: Support and Development
Topic: Table, loops and other stuff problems
Replies: 2
Views: 1220

Re: Table, loops and other stuff problems

the i = block_type line in block_add() is suspect since it's just going to store a reference to one of those block_type tables. so all of your blocks of a specific type are going to be referencing the same data, one of which is the color. you'll probably want to store the alpha per-instance instead
by Xgoff
Sun Feb 24, 2013 12:35 am
Forum: Support and Development
Topic: Why use ipairs and not just #?
Replies: 8
Views: 5366

Re: Why use ipairs and not just #?

plus, ipairs and a numeric loop using # behave differently: ipairs will stop at the first nil, # will stop at whichever nil it wants (the typical problem it has with holes)
by Xgoff
Wed Feb 20, 2013 5:09 pm
Forum: General
Topic: Will we ever see LuaJIT powered LÖVE?
Replies: 11
Views: 7502

Re: Will we ever see LuaJIT powered LÖVE?

The (massive) speed boost provided by LuaJIT would allow making much more demanding games in LÖVE. the potential massive speed boost code that contains love api calls (or any calls to c libraries not bound through the ffi) likely isn't going to get much faster very mathy or otherwise pure lua code ...