maybe im just nit picking...

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
hairy puppy
Prole
Posts: 29
Joined: Tue Apr 22, 2014 3:34 pm

maybe im just nit picking...

Post by hairy puppy »

hello all,

enjoying LOVE like the 6 year old me enjoying disneyland.

though i do have a question or two regarding the syntax of LOVE, maybe even lua, but more on LOVE right now.
since it is mainly dealt with camel case [whereTheTextLooksLikeThis]. then why doesnt things like love.keypressed, or even love.keyreleased have them, like love.keyPressed and love.keyReleased. there are others, but these stuck out because ive been using them just now.
i may be nit picking here, but those keyboard functions have say .setKeyRepeat and so forth.

i guess im just looking at this as keeping things consistent. but just wanted to ask none-the-less. i guess coming from an arduino/c/c++ kind of call, then im just used to those things.
lewis lepton
------
http://smokingbunny.net
User avatar
slime
Solid Snayke
Posts: 3163
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: maybe im just nit picking...

Post by slime »

User avatar
hairy puppy
Prole
Posts: 29
Joined: Tue Apr 22, 2014 3:34 pm

Re: maybe im just nit picking...

Post by hairy puppy »

thanks for that. i chimed in my annoying 2 cents too it ;)
lewis lepton
------
http://smokingbunny.net
User avatar
OttoRobba
Party member
Posts: 104
Joined: Mon Jan 06, 2014 5:02 am
Location: Sao Paulo, Brazil

Re: maybe im just nit picking...

Post by OttoRobba »

Just to point out that some modules will abide by a lowercase naming convention due to how Lua's core functions are written (and this might be why LÖVE's callbacks are as they are now).

dofile
setmetable
math.randomseed
debug.traceback
...
and so on.

PS: Welcome to LÖVE :D
User avatar
hairy puppy
Prole
Posts: 29
Joined: Tue Apr 22, 2014 3:34 pm

Re: maybe im just nit picking...

Post by hairy puppy »

aye, well the functions for onFocus, keyPressed etc have been the centre of attention. but thanks for letting me know. good to keep in the loop
lewis lepton
------
http://smokingbunny.net
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: maybe im just nit picking...

Post by HugoBDesigner »

You can always have this on the top of main.lua or in the beggining of love.load:

Code: Select all

love.keyPressed = love.keypressed
love.keyReleased = love.keyreleased
love.mousePressed = love.mousepressed
love.mouseReleased = love.mousereleased
--Any other code. You got my point
But yeah, I think I'd prefer uppercase too (even though it'd break 100% of LÖVE games).
@HugoBDesigner - Twitter
HugoBDesigner - Blog
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: maybe im just nit picking...

Post by Inny »

I'd go one step further and ask why the callbacks aren't subscriptions

Code: Select all

love.on_update(function(dt)
    inny.writes.too.much:javascript()
end)
User avatar
OttoRobba
Party member
Posts: 104
Joined: Mon Jan 06, 2014 5:02 am
Location: Sao Paulo, Brazil

Re: maybe im just nit picking...

Post by OttoRobba »

Inny wrote:I'd go one step further and ask why the callbacks aren't subscriptions

Code: Select all

love.on_update(function(dt)
    inny.writes.too.much:javascript()
end)
Image
User avatar
slime
Solid Snayke
Posts: 3163
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: maybe im just nit picking...

Post by slime »

Inny wrote:I'd go one step further and ask why the callbacks aren't subscriptions

Code: Select all

love.on_update(function(dt)
    inny.writes.too.much:javascript()
end)
In my eyes, that code snippet is the perfect illustration for why LÖVE will not do that. :monocle:
User avatar
Ragzouken
Citizen
Posts: 84
Joined: Fri Aug 10, 2012 7:59 am
Contact:

Re: maybe im just nit picking...

Post by Ragzouken »

all i ask is please avoid putting "on" in front of everything D:
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests