Search found 1530 matches

by pgimeno
Sun Feb 03, 2019 6:13 pm
Forum: General
Topic: slower sandboxed lua
Replies: 2
Views: 769

Re: slower sandboxed lua

You're looking at the wrong project. Try Minetest instead of Minecraft.

In particular, this mod implements a LuaController, with a fairly secure sandbox:
https://github.com/minetest-mods/meseco ... controller
by pgimeno
Sat Feb 02, 2019 8:09 pm
Forum: Support and Development
Topic: "Islands" not being generated after certain x/y value
Replies: 3
Views: 902

Re: "Islands" not being generated after certain x/y value

The # operator isn't guaranteed to work unless the arrays start in 1. I think LuaJIT is more forgiving about not starting exactly with 1, but not as much as 1000 times more forgiving. The problem seems to be in the iteration limit for the drawing loop. Changing it to this worked for me: for x = isla...
by pgimeno
Sat Feb 02, 2019 9:06 am
Forum: General
Topic: LuaSocket Help?
Replies: 6
Views: 1041

Re: LuaSocket Help?

by pgimeno
Fri Feb 01, 2019 8:07 pm
Forum: General
Topic: LuaSocket Help?
Replies: 6
Views: 1041

Re: LuaSocket Help?

The code is somewhat hard to follow for me. What I could notice is an alarming lack of calls to socket.select(). Also, sockets typically have either a high timeout (if they're designed to be blocking) or a zero timeout (if not), because socket.select() usually does the wait. For an example of a (col...
by pgimeno
Thu Jan 31, 2019 11:49 am
Forum: Support and Development
Topic: [SOLVED] Doubt LinearVelocity
Replies: 2
Views: 1000

Re: Doubt LinearVelocity

I don't understand the issue well. Do you mean that using the controls to "press" against the wall keeps the player from falling? If so, that might be a friction issue. I did this experiment and it worked for me: local lph, lg = love.physics, love.graphics local world = lph.newWorld(0, 400) local bo...
by pgimeno
Wed Jan 30, 2019 11:53 pm
Forum: Support and Development
Topic: Class Best Practices
Replies: 16
Views: 3616

Re: Class Best Practices

Well, before going down that rabbit hole, try to profile. Maybe you can't expect that much of a gain.
by pgimeno
Wed Jan 30, 2019 12:46 am
Forum: General
Topic: Floating Point color
Replies: 15
Views: 1794

Re: Floating Point color

Just wait for 11.3 and use colorToBytes (or make your own, or use cindy).
by pgimeno
Tue Jan 29, 2019 5:09 pm
Forum: Support and Development
Topic: Class Best Practices
Replies: 16
Views: 3616

Re: Class Best Practices

When you are saying clearing, are you refering to looping through the list and selling each element to nil? Setting, yes. Also would the speed still be the same if it is just an array with table references and no explicit key? (i.e. {#eA23dc, #dsf234, etc..}) If you mean {table1, table2, ...} then ...
by pgimeno
Tue Jan 29, 2019 3:37 pm
Forum: General
Topic: Floating Point color
Replies: 15
Views: 1794

Re: Floating Point color

Here is the problem. The function rnd() will produce a set of fp numbers evenly distributed over the range 0 .. 1. When applied to the 2 bit color field, how do you ensure that each bin will be evenly distributed? Easy, take the floor of multiplying the random number by 4 and you'll get an evenly d...