Page 1 of 1

Four hours of Love

Posted: Fri Mar 18, 2016 9:20 pm
by mr_happy
Installed Love (how does one get those umlauts over the 'o' on a UK keyboard?) a little earlier on my Linux Mint 'tinkering machine'. Decided to try it with an IDE (I don't normally use such things) so I installed Zerobrane as well.

Four hours later and I've managed to learn enough Love/Lua to port the basics of my map generator (that I previously concocted in Processing and then ported to D/Allegro). I've even figured out modules, saving the map to a file, zooming via the mouse-wheel and debugging. Screeny attached. I didn't get any further with the game in its previous incarnations, but think I could press ahead with it in Love2D.

I have to say I'm quite impressed with how easy Love is to get into, how light it feels, even using Zerobrane, and how speedy it seems to be - I was expecting it to be much more sluggish. So, well done developers and wiki writers. :awesome:

A couple of questions about general coding style though: what is considered best practice with regard to naming - I rather like camelCase for variables (but can live with underscores), MixedCase for classes (don't know if I would use them in Lua, looks a bit obtuse to what I'm used to!) and UPPERCASE for constants (which don't seem to exist!). What does everyone else do?

Re: Four hours of Love

Posted: Fri Mar 18, 2016 10:08 pm
by Tesselode
mr_happy wrote: A couple of questions about general coding style though: what is considered best practice with regard to naming - I rather like camelCase for variables (but can live with underscores), MixedCase for classes (don't know if I would use them in Lua, looks a bit obtuse to what I'm used to!) and UPPERCASE for constants (which don't seem to exist!). What does everyone else do?
That's what I do. I feel like a lot of Lua is written with underscores, but underscores are ugly as sin. I don't know how anyone can stand them.

Re: Four hours of Love

Posted: Sat Mar 19, 2016 9:05 am
by mr_happy
Cheers Tesselode, I'll stick with what I'm used to then.

mrUnderscoreHappy ( :awesome: )

Re: Four hours of Love

Posted: Sat Mar 19, 2016 4:04 pm
by Ranguna259
camelCase with the first letter as underscore FTW

Re: Four hours of Love

Posted: Sat Mar 19, 2016 4:32 pm
by mr_happy
Ranguna259 wrote:camelCase with the first letter as underscore FTW
That always gives me the impression of some sort of system thing I shouldn't mess with, dunno why. Makes them easier to spot I suppose...

Re: Four hours of Love

Posted: Sat Mar 19, 2016 7:36 pm
by Beelz
I do things weird, but it helps me to remember...

Code: Select all

CAMEL_CASE  -- Globals/debug
_camelCase  -- Constants
camelCase   -- Variables/functions/etc