Search found 11 matches

by Exasperation
Wed May 14, 2014 3:15 am
Forum: Support and Development
Topic: How to refer to a table inside another table?
Replies: 14
Views: 2724

Re: How to refer to a table inside another table?

I pretty regularly use functions with optional parameters in Lua; the following is a perfectly reasonable thing to do: foo = function (bar, optional_flag) apply_bar(bar) if optional_flag == false then do_something() end end foo(bat) and I don't think it's less readable than this equivalent: foo = fu...
by Exasperation
Tue May 13, 2014 3:22 pm
Forum: Support and Development
Topic: How to refer to a table inside another table?
Replies: 14
Views: 2724

Re: How to refer to a table inside another table?

Wait a second... this:

Code: Select all

not nil
returns true while this:

Code: Select all

nil == false
returns false.

So, since the two options behave differently for the same input, shouldn't we use the one that provides the desired behavior in whatever particular situation we're using it?
by Exasperation
Thu Oct 07, 2010 1:39 am
Forum: Libraries and Tools
Topic: Messing around with isometrics - more progress shots
Replies: 10
Views: 4454

Re: Messing around with isometrics - more progress shots

No, setScissor wouldn't do anything like what I want. setScissor restricts the drawing area to some portion of the display. If you look at this image again: http://i117.photobucket.com/albums/o48/ExaMind/iso2.png That shows the contents of a framebuffer that is normally never displayed, only stored ...
by Exasperation
Wed Oct 06, 2010 6:50 pm
Forum: Support and Development
Topic: Quick Question. Generic for not updating all values.
Replies: 1
Views: 769

Re: Quick Question. Generic for not updating all values.

You're overwriting 'some' too often in your loop. Try something like this:

Code: Select all

local cntr = 0
for i, v in ipairs(rocks) do
    if checkHit(xan,v) then
        cntr = cntr + 1
    end
end
some = string.format("Hitting %d rocks.", cntr)
by Exasperation
Wed Oct 06, 2010 5:49 pm
Forum: Libraries and Tools
Topic: Messing around with isometrics - more progress shots
Replies: 10
Views: 4454

Re: Messing around with isometrics - now prettier

Thanks! I expect I'll have to implement some sort of depth sorting, yeah. Haven't really decided on how I want to do that yet, though. And yes, this is in 0.7 (has to be, since framebuffers are newly supported in 0.7). Also, some more progress shots: http://i117.photobucket.com/albums/o48/ExaMind/is...
by Exasperation
Mon Oct 04, 2010 1:18 am
Forum: General
Topic: math.floor()
Replies: 21
Views: 4430

Re: math.floor()

fwoop wrote:In layman terms, Floor cuts all the decimal rubbish off the end. Sometimes called truncation.

examples:
floor(3.14159) returns 3
floor(4.99999998) returns 4
floor(5) returns 5
That's only true for non-negative numbers. floor(-0.5) is -1, not 0.
by Exasperation
Mon Oct 04, 2010 1:05 am
Forum: General
Topic: math.floor()
Replies: 21
Views: 4430

Re: math.floor()

The floor of a number is the greatest integer less than or equal to that number.
by Exasperation
Sun Oct 03, 2010 11:16 pm
Forum: General
Topic: Avatars: OBEY!
Replies: 726
Views: 227113

Re: Avatars: OBEY!

That was an awful lot of work for such a small image. But there it is!
by Exasperation
Sun Oct 03, 2010 6:31 pm
Forum: Libraries and Tools
Topic: Messing around with isometrics - more progress shots
Replies: 10
Views: 4454

Re: Messing around with isometrics

Yeah. I use b for type of element and r+g for the individual element. So the buttons around the edge are colored 50,50,250 through 56,50,250 (and the next one will be 57,50,250), while the map tiles are colored 51,51,50 through 50+mapsize.x,50+mapsize.y,50. I've started working on a main menu, and o...
by Exasperation
Sun Oct 03, 2010 4:08 pm
Forum: Libraries and Tools
Topic: Messing around with isometrics - more progress shots
Replies: 10
Views: 4454

Re: Messing around with isometrics

I haven't even looked at collision yet. That's sort of in the "create an actual game" to-do item. Everything I had implemented as of the previous posting is listed in the post (I don't think I forgot anything, at least). Since then, I have gotten map rotation done, so now you can turn the map by 90 ...