Search found 40 matches
- Thu Aug 25, 2011 2:33 pm
- Forum: Support and Development
- Topic: What module/class structure should I use in this case?
- Replies: 4
- Views: 3388
What module/class structure should I use in this case?
Hi guys, I'm currently building a drawing library for Love which makes it easy to draw geometric shapes likes arcs, ellipses, isosceles triangles, ovoids, etc... I'm almost done all my basic functions, but I'm wondering how I should structure my code. One thing I realize is that I can't possibly cov...
- Sun Aug 21, 2011 3:44 am
- Forum: Support and Development
- Topic: Lua local question
- Replies: 33
- Views: 15415
Re: Lua local question
I'm not too sure what's the problem with your example.
- Fri Aug 19, 2011 9:39 am
- Forum: Support and Development
- Topic: Lua local question
- Replies: 33
- Views: 15415
Re: Lua local question
I don't think there is, but I don't see why this would be necessary. Just declare the variable at the top of the file.
I think this is the clearest way no. Declare variables in the scope that they will operate.
Code: Select all
local b
function lol()
b = somethingRather
end
- Wed Aug 17, 2011 2:32 am
- Forum: Support and Development
- Topic: Lua local question
- Replies: 33
- Views: 15415
Re: Lua local question
I tested this profusely. The if/then structure seems like the only one which works in this case and it's easy to read. My default value can be false, or some string.
If only Lua supported ternary conditionals. If only...
If only Lua supported ternary conditionals. If only...
- Wed Aug 17, 2011 2:28 am
- Forum: General
- Topic: MoonScript & love
- Replies: 35
- Views: 27356
Re: MoonScript & love
Lua would be super awesome if it could just fix a few things to streamline the syntax. I find it unacceptable that it does not have the following features: 1) default params for functions, 2) += operators, 3) ternary conditionals. I also prefer braces to the if/then/else/end syntax which reminds me ...
- Tue Aug 16, 2011 6:10 pm
- Forum: Support and Development
- Topic: Lua local question
- Replies: 33
- Views: 15415
Re: Lua local question
Thanks for all your quick responses guys. 1) I'm a little surprised that local is not needed in my first example since all the code Iv'e looked at for Love always seems to use it. I'm thinking of Hump as an example. 2) I should have been more specific. My parameter can be boolean value or a string a...
- Tue Aug 16, 2011 12:19 pm
- Forum: Support and Development
- Topic: Lua local question
- Replies: 33
- Views: 15415
Lua local question
Hi guys, I read all the docs I could find on the Lua language, but the use of local keyword when creating default values for function parameters is still unclear to my mind. I see this a lot. I imagine the local keyword should be used in this instance. function my_func(someArg) local someArg = somea...
- Tue Aug 16, 2011 12:06 pm
- Forum: General
- Topic: MoonScript & love
- Replies: 35
- Views: 27356
Re: MoonScript & love
It seems like a really powerful language. You've fixed a lot of things I don't like about Lua, like repeating local, not being able to do +=, and the massively annoying fact that function parameters cannot have default values. Good job. My only criticism is that the language is a tad too flexible fo...
- Tue Aug 16, 2011 8:07 am
- Forum: Support and Development
- Topic: Maximum number of vertices in polygon shapes
- Replies: 6
- Views: 2946
Re: Maximum number of vertices in polygon shapes
The maximum number of polygon vertices can be set in Box2D with the b2_maxPolygonVertices parameter. The default is indeed 8, but it would be nice if Love let us change that like it's possible with Box2D. I used the shape creator and it's really nice, the only thing that I found missing was the abil...
- Mon Aug 15, 2011 11:32 pm
- Forum: Support and Development
- Topic: Maximum number of vertices in polygon shapes
- Replies: 6
- Views: 2946
Maximum number of vertices in polygon shapes
Hi guys,
I'm new on these boards, and enjoying learning Love and Lua. I'm currently working on an editor for Box2D and was wondering why there was a limit of 8 vertices on polygon shapes?
Thanks,
I'm new on these boards, and enjoying learning Love and Lua. I'm currently working on an editor for Box2D and was wondering why there was a limit of 8 vertices on polygon shapes?
Thanks,