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.
maybe im just nit picking...
- hairy puppy
- Prole
- Posts: 29
- Joined: Tue Apr 22, 2014 3:34 pm
- hairy puppy
- Prole
- Posts: 29
- Joined: Tue Apr 22, 2014 3:34 pm
Re: maybe im just nit picking...
thanks for that. i chimed in my annoying 2 cents too it
Re: maybe im just nit picking...
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
dofile
setmetable
math.randomseed
debug.traceback
...
and so on.
PS: Welcome to LÖVE
- hairy puppy
- Prole
- Posts: 29
- Joined: Tue Apr 22, 2014 3:34 pm
Re: maybe im just nit picking...
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
- 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...
You can always have this on the top of main.lua or in the beggining of love.load:
But yeah, I think I'd prefer uppercase too (even though it'd break 100% of LÖVE games).
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
Re: maybe im just nit picking...
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)
Re: maybe im just nit picking...
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)
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: maybe im just nit picking...
In my eyes, that code snippet is the perfect illustration for why LÖVE will not do that.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)
Re: maybe im just nit picking...
all i ask is please avoid putting "on" in front of everything D:
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests