In Love with LÖVE
an.ton.io
an.ton.io
For reference: https://love2d.org/
If you're new to OSX I highly recommend playing about seeing which characters are possible. Hold Option and try each key, then Option+Shift and each key. Comes in handy for typing things like ©2013, 20˚, 2π and LÖVE
although i recommend just skipping to the wiki https://www.love2d.org/wiki/Main_Page
Edit: HA simul-post and a ninja edit.
Still I recommend the wiki, the docs are well done.
I haven't used Lua myself, but I'm impressed by the design: it seems like an elegant version of JavaScript minus most of the really obnoxious JavaScript warts.
The tables and metatables seem particularly great: they look like a simple, elegant version of prototype-based inheritance without some of the problems JavaScript suffers. It's certainly simpler and more expressive than a class-based system.
Also, Lua is well known for having coroutines that are done correctly. That's probably not immediately useful for complete beginners, but it's certainly a nice feature when you get to it.
I general yes Lua is a great language, I have a lot of fun writing in it. But it does have its warts (though fewer than Javascript).
Deleted comment
Let's take a trivial example that would work in JavaScript or Scheme. Often, I want to keep track of how many times a particular function gets called (usually for debugging). I would expect to be able to do something like this:
counter = 0
def foo(bar, baz):
counter += 1
...
This does not work in Python. You could use the global keyword to work around this: counter = 0
def foo(bar, baz):
global counter
counter += 1
...
This is something of an ugly hack in the language design. Moreover, this falls apart if counter is not in the global scope itself--for example, if foo is defined inside another function. Python 3 introduces the nonlocal keyword to deal with this.Fundamentally, this problem stems from the fact that Python conflates two fundamentally different operations: defining a variable and mutating it. I personally really like how Scheme handles this: defining and setting are two different actions, and trying to set a variable that has not been defined is an error. This makes the intentions of the programmer much clearer.
A very common pattern in Scheme and JavaScript (as well as other languages I don't use, no doubt) is to use closures to encapsulate state. Thanks to Python's scoping model, this is at best a pain and certainly unnatural.
There are also some minor annoyances. One that gave me problems recently (although it has been fixed in Python 3, I believe), was with list comprehensions:
[i * i for i in range(1, 10)]
print i # gives you 9!It is also unnecessary. Python has normal classes, so you can contain your state within objects rather than stackframes.
For the first example, I don't see how you could replace it with yield, especially if the function foo has to normally return a value when it's used. The core idea is to count how many times foo is called without altering the call site at all. Also, this is an entirely trivial example to illustrate the scoping issue; in practice, there are more complicated reasons to want to set non-local variables, especially from things like helper functions.
Lua also makes all loop indexes local to the loop which is very clean. Python has difficulty with this.
LÖVE is a very fun engine, much easier than PyGame to get going - in both setup and development terms.
A more elaborate argument: http://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831....
If it's for a 1-based language, it's wrong because it compares with "<" and not "<=".
So, I guess that proves your point that it's error-prone. :)
In C, the idiomatic way is (as you surely know) "for(i = 0; i < n; ++i)".
Beyond that it's a fantastically easy way to get started writing a game.
Though I would assume most library authors are not necessarily attempting to be offensive, not the greatest culture to construct around your toolset regardless.
Also males such as myself that are just tired of peurile humour when they witness the darker side of their peers so frequently?
http://www.giantbomb.com/news/eight-women-eight-responses-an...
among other examples - what counts as acceptable behavior in the gaming community is a pretty hot topic right now. there is a strong argument to be made that anything that isn't acceptable in the business community should be discouraged in gaming.
'HardonCollider' collision system, 'Lube' networking library etc, I can hardly see anyone being offended unless they _really_ want to be.
Apart from that I fully agree, despite doing lots of coding in Python, I, just like the author find löve a better choice than pygame for quickly developing/prototyping games, YMMV and all that.
Like, by itself, not a gamebreaker or anything (for me that would be a weakly typed language--though I've encouraged my little brother to play with Moai, another Lua environment, in the past), but given the choice I'd probably go with tools with a culture that encourages a bit better judgment.
And look where I am now, happily employed software developer with >=1000 karma.
So I wouldn't worry too much.
This what surprised me most about the post. Lua is not especially strange, by any means, and also fairly well known. Obviously, its hard to compare my experience with his experience, but nonetheless I was quite surprised he said something like that.
«a language which may not please the purists»
I would have stopped reading here, but the article was already over...
With regards to the "crappy scoping", I can only assume he didn't read up properly, especially since both the globals and locals mentioned right after do exist.
Moai, compared, is probably a richer framework but seems fairly closed. I'm also slightly confused by the paid for cloud component. Is this necessary for making games? What part, or how much of Moai is free or open?
Check out the license here: http://opensource.org/licenses/cpal_1.0
The cloud is an additional service, which you are not required to use - but is there if you do need it. Its one small point of confusion in the MOAI world, that people think that MOAI Cloud is MOAI itself, but thats not the case. Its just an additional service that can be utilized by users of the MOAI SDK, if they want it ..
Sure there are ways it can be done, jruby + swing and shooes or monkeybars etc but they all have big drawbacks compared to "Just Works" languages.
[EDIT] Having said that, the releasey gem used by gosu looks interesting.
Here are some demo applications converted to HTML5/WebGL: http://ghoulsblade.schattenkind.net/love-webplayer/