Search found 650 matches

by airstruck
Tue Jul 07, 2015 9:33 am
Forum: Support and Development
Topic: [Solved]Strange Console Output
Replies: 9
Views: 4528

Re: [Solved]Strange Console Output

In this case you should write to [manual]io.stdout[/manual] instead of using print, you can use it as a file and move to an specific position, delete, rewrite, insert, etc You can? I tried this: io.stdout:write(i) io.stdout:seek('cur', -1) But nothing happened. I've never heard of being able to &qu...
by airstruck
Mon Jul 06, 2015 3:55 pm
Forum: General
Topic: LÖVE HÖÖKS
Replies: 4
Views: 1912

Re: LÖVE HÖÖKS

Ahh yeah, removing them will be more of a pain. How's this? local hooks = {} local function initHooks (name) if hooks[name] then return end local f = love[name] hooks[name] = {} love[name] = function (...) for k, callback in ipairs(hooks[name]) do callback(...) end return f(...) end end local functi...
by airstruck
Mon Jul 06, 2015 3:21 pm
Forum: General
Topic: LÖVE HÖÖKS
Replies: 4
Views: 1912

Re: LÖVE HÖÖKS

Am I doing it right?

Code: Select all

local function hook (name, callback)
    local f = love[name]
    love[name] = function (...)
        callback(...)
        return f(...)
    end
end

-- example
local foo = 0
hook('update', function (dt)
    foo = foo + dt
end)
by airstruck
Sun Jul 05, 2015 7:28 pm
Forum: Support and Development
Topic: [Solved]Strange Console Output
Replies: 9
Views: 4528

Re: Strange Console Output

Tried using ANSI escape sequences ? print(string.char(27) .. "[2F") print(i) That works fine in bash, just moves cursor up a line and to the beginning of column. Not sure what level of ANSI support cmd.exe has, but you should be able to find a cross-platform solution. function sleep(n) -- ...
by airstruck
Sat Jul 04, 2015 3:37 pm
Forum: Games and Creations
Topic: dir - A match-N puzzle game
Replies: 20
Views: 10208

Re: dir - A match-N puzzle game

I currently don't have an android device to test it Google "net-10 phone" or "tracphone," you can get low-end android devices really cheap (like under $20) from these pay-as-you-go phone services. I use one for testing stuff on an unusually small screen. A store near me was adve...
by airstruck
Sat Jul 04, 2015 6:34 am
Forum: Support and Development
Topic: [SOLVED] Yo dawg I heard you like coroutines
Replies: 2
Views: 2189

Re: Yo dawg I heard you like coroutines

Can you post an example of how your code looked when it was overflowing the call stack? There are probably better options than coroutines for avoiding that. Might be best to restructure things so you're not using so much recursion, but you could also probably do something simple like taking advantag...
by airstruck
Sat Jul 04, 2015 2:11 am
Forum: Games and Creations
Topic: dir - A match-N puzzle game
Replies: 20
Views: 10208

Re: dir - A match-N puzzle game

Really nicely done, I keep coming back for more. Still trying to break 300k, is 625k your best score? https://love2d.org/imgmirrur/nTCuHuF.png you should get this into the play store with touch controls! Yeah, the mouse controls sound more awkward than they really are, but swiping would be perfect f...
by airstruck
Fri Jul 03, 2015 9:47 pm
Forum: Libraries and Tools
Topic: Tactile - a nice, straightforward input library!
Replies: 21
Views: 11170

Re: Tactile - a nice, straightforward input library!

I've just had a look at the code, it looks pretty good but attaching properties to return objects seems strange when the functions that mostly deal with those values are defined inside closures where they already have access to those values. I've made a pull request so you can see what I mean, but i...
by airstruck
Fri Jul 03, 2015 5:08 am
Forum: Libraries and Tools
Topic: Tactile - a nice, straightforward input library!
Replies: 21
Views: 11170

Re: Tactile - a nice, straightforward input library!

I mean right now you identify the things you're creating with a primitive value, right, a string that you pass in. You could still identify them with a primitive value, just use a number that you generate with a simple counter. Instead of passing that id in to functions like getFooDetector, assign i...
by airstruck
Fri Jul 03, 2015 2:27 am
Forum: Libraries and Tools
Topic: Tactile - a nice, straightforward input library!
Replies: 21
Views: 11170

Re: Tactile - a nice, straightforward input library!

If you don't want to return an object, you could even do things exactly the same way, except have a counter to make new ids for things. Then you'd only need to add a counter and a function to increment it and return the next value, and remove the first parameter from some functions and have them ret...