Search found 651 matches

by Inny
Sun Jul 03, 2016 12:20 am
Forum: General
Topic: Mini Functions Repository
Replies: 48
Views: 41422

Re: Mini Functions Repository

Something I like to do is muck with the global environment a little bit before loading everything. For instance, this is a handy thing to do with table.unpack and table.pack -- Make unpack and table.unpack be the same function, regardless of version if table.unpack then unpack = table.unpack else ta...
by Inny
Wed Jun 29, 2016 3:23 pm
Forum: Support and Development
Topic: gamepad - how to access the input data.
Replies: 12
Views: 8066

Re: gamepad - how to access the input data.

I highly recommend using the Gamepad functions. For instance, the Joystick:isGamepadDown function to check the buttons, rather than the direct method. Because you said you're going to get an xbox360 controller in the future, this is the method that offers the most compatibility. Read Also, if you fe...
by Inny
Wed Jun 29, 2016 12:14 am
Forum: General
Topic: Snaps and Linux distribution
Replies: 8
Views: 5621

Re: Snaps and Linux distribution

The general consensus that the love developers won't preserve backwards compatibility came late enough that way its packaged is incorrect. The windows installer is easy enough, I've already taken to installing all of the versions back to 0.8 separate of each other. The .deb or PPA is difficult and m...
by Inny
Mon Jun 27, 2016 5:18 pm
Forum: General
Topic: Concise game implementations
Replies: 6
Views: 4211

Re: Concise game implementations

A few years ago I ported HAMURABI.BAS to lua, it's not "concise" but I figure it's worth a mention: https://gist.github.com/inmatarian/5121902
by Inny
Tue Jun 21, 2016 3:07 pm
Forum: Support and Development
Topic: Timers
Replies: 5
Views: 2728

Re: Timers

timer = 4 function love.update(dt) time = time - dt if time <= 0 then -- do stuff time = 4 -- if you want to restart end end If you were trying to accurately time something to happen every 4 seconds, this clock would rapidly lose milliseconds. For instance, 60FPS is a dt value of rougly 0.016, whic...
by Inny
Sun Jun 19, 2016 5:14 pm
Forum: Support and Development
Topic: Pseudo-3D as of version 10?
Replies: 4
Views: 3308

Re: Pseudo-3D as of version 10?

Drawing sprites in correct Z order is the easiest part. Instead of keeping their X and Y as their highest and leftmost point, keep it as their lowest and centered point. Then your z-order is table.sort(sprites, function(a, b)return a.y < b.y end) The trick is drawing all of the sprites in this pseud...
by Inny
Fri Jun 17, 2016 4:43 pm
Forum: Support and Development
Topic: Approaching using a header-only C library
Replies: 12
Views: 5808

Re: Approaching using a header-only C library

I must say though, I am curious about what you mean by blocking calls. Can you give an example? A blocking call is when you make a function call and your current code doesn't resume execution until the other function returns with the intended output you wanted. This is in contrast to an asynchronou...
by Inny
Thu Jun 16, 2016 9:49 pm
Forum: Support and Development
Topic: Approaching using a header-only C library
Replies: 12
Views: 5808

Re: Approaching using a header-only C library

That library in particular appears to be both C macro heavy, so I doubt ffi will work for it, plus it looks like it relies on blocking calls, which wouldn't work with the the stock love.run function (which creates an event loop, that you shouldn't block). As for your original problem, the desire to ...
by Inny
Wed Jun 15, 2016 9:41 pm
Forum: General
Topic: Snaps and Linux distribution
Replies: 8
Views: 5621

Re: Snaps and Linux distribution

I volunteer to be the curmudgeon in this thread! I still highly recommend that everybody should release their game as a .love file, in addition to the other release formats they'll be putting out. That said, yeah I can see this being useful. I think flatpak is the more interesting system, but if sna...
by Inny
Tue May 31, 2016 7:23 pm
Forum: Support and Development
Topic: multiple inheritance?
Replies: 11
Views: 7567

Re: multiple inheritance?

This is where the notions of Classical Inheritance and Classical Object Oriented Programming start to fall apart within a dynamically (duck) typed language. Since you don't have a static compiler vetoing your code from type mismatches, here's my other recommendation. Duplicate code . Write each clas...