Search found 5 matches
- Wed Sep 12, 2012 12:54 am
- Forum: Support and Development
- Topic: Multiple Recursion
- Replies: 7
- Views: 3096
Re: Multiple Recursion
Here's the problem: local adjTiles = { self:getTile(tile.x + 1, tile.y), self:getTile(tile.x - 1, tile.y), self:getTile(tile.x, tile.y + 1), self:getTile(tile.x, tile.y - 1) } for i,v in ipairs(adjTiles) do Hint: ipairs(t) Returns three values: an iterator function, the table t, and 0, so that the ...
- Tue Sep 11, 2012 9:03 pm
- Forum: Support and Development
- Topic: Multiple Recursion
- Replies: 7
- Views: 3096
Re: Multiple Recursion
Thanks for the answers! Wild guess, but you exit before setting tile.walkedOn to true if tile.type equals 'x'. Moving 'tile.walkedOn = true' to the start of the function might fix your problem. I've changed my function a bit to avoid this from happening. Now, a tile with type == 'x' doesn't even exp...
- Tue Sep 11, 2012 2:11 am
- Forum: Support and Development
- Topic: Multiple Recursion
- Replies: 7
- Views: 3096
Multiple Recursion
Hello everyone, I am working on a project for my A.I. class and I have encountered a problem (which I recall having a few years ago on another project). I don't know if this is a Lua or LOVE problem (most probably lua), you guys might be able to help... I have the following local function: local fun...
- Tue Apr 10, 2012 2:26 pm
- Forum: Support and Development
- Topic: How can I achieve this?
- Replies: 3
- Views: 2511
Re: How can I achieve this?
In lua, you will mainly be working with "states" (as in a lot of game engines). States are classes (in lua, metatables) that will be loaded in certain events. So your main menu will be a state, options menu, instructions, etc. AND your game are all states. You can see a perfect example of ...
- Tue Apr 10, 2012 2:04 pm
- Forum: Support and Development
- Topic: Any way to make textbox inputs?
- Replies: 6
- Views: 5063
Re: Any way to make textbox inputs?
Its not that hard really, you'd have to create a Textbox class and some basic methods other than update and draw. You'd have something more or less like this: Textbox = {} Textbox.__index = Textbox function Textbox.create(x, y, max) local temp = {} setmetatable(temp, Textbox) temp.hover = false temp...