Page 1 of 2
Hi, I'm wondering how to create my first game
Posted: Sat Jan 12, 2013 8:04 am
by tavuntu
Hi everyone I'm a programmer and I know only a few about lua but I'd like to create my first game, and pack it in a .love file of course (somenting like a circle which can be moved with the keyboard arrows or something simple like that). Thanks a lot and regards, sorry for the bad english.
Re: Hi, I'm wondering how to create my first game
Posted: Sat Jan 12, 2013 2:29 pm
by scutheotaku
tavuntu wrote:Hi everyone I'm a programmer and I know only a few about lua but I'd like to create my first game, and pack it in a .love file of course (somenting like a circle which can be moved with the keyboard arrows or something simple like that). Thanks a lot and regards, sorry for the bad english.
Welcome!
To make your first game, first step through these quick lessons:
https://love2d.org/wiki/Getting_Started
https://love2d.org/wiki/Tutorial:Callback_Functions
http://nova-fusion.com/2011/06/14/a-gui ... th-love2d/
Then, perhaps you could following this tutorial:
https://love2d.org/wiki/Tutorial:Hamster_Ball
Or maybe you'll find video tutorials easier to follow. Here are some that start you from the very beginning:
http://sockmunkee.com/videos/
http://www.youtube.com/playlist?list=PL924F20B05A624D91
You can find other LOVE tutorials here:
https://love2d.org/wiki/Category:Tutorials
As for making a .love file:
https://love2d.org/wiki/Game_Distribution
EDIT:
Also, if you need to brush up on Lua, check out these two resources:
http://www.lua.org/pil/#online
http://lua-users.org/wiki/TutorialDirectory
Re: Hi, I'm wondering how to create my first game
Posted: Sat Jan 12, 2013 8:06 pm
by tavuntu
Thanks a lot
I'll check that.
Re: Hi, I'm wondering how to create my first game
Posted: Sat Jan 12, 2013 11:17 pm
by ejmr
All of the links from scutheotaku are great resources. I would only suggest one other:
http://www.lua.org/manual/5.1/
This is the official reference for Lua 5.1, which LÖVE uses. Most of the information in that reference is also in the 'Programming in Lua' link that scutheotaku gave. However, that edition of 'Programming in Lua' covers version 5.0 of Lua. If I remember correctly there are not
that many differences, but you may find the 5.1 reference useful for when you need to quickly lookup a standard library function for Lua 5.1, things like that.
Good luck with your game.
Re: Hi, I'm wondering how to create my first game
Posted: Sun Jan 13, 2013 4:07 am
by scutheotaku
ejmr wrote:All of the links from scutheotaku are great resources. I would only suggest one other:
http://www.lua.org/manual/5.1/
This is the official reference for Lua 5.1, which LÖVE uses. Most of the information in that reference is also in the 'Programming in Lua' link that scutheotaku gave. However, that edition of 'Programming in Lua' covers version 5.0 of Lua. If I remember correctly there are not
that many differences, but you may find the 5.1 reference useful for when you need to quickly lookup a standard library function for Lua 5.1, things like that.
Good luck with your game.
'
Ah, yeah, good point!
If you'd like Programming in Lua for Lua 5.1, you can get it but AFAIK not online for free (well, not legally). You can buy it in book-form, though make sure that you get the
SECOND edition (the first edition is Lua 5.0, the second is 5.1, and the third is 5.2):
http://www.amazon.com/exec/obidos/ASIN/ ... ilindex-20
Though, since you have past programming experience and Lua is a pretty simple language, the 5.1 reference manual ejmr posted and the other links above will probably be more than sufficient
Re: Hi, I'm wondering how to create my first game
Posted: Sun Jan 13, 2013 10:14 am
by T-Bone
Lua is really easy to use in most cases. And for all the more complicated stuff you might run into, you can always download a small library to do the heavy lifting for you.
Re: Hi, I'm wondering how to create my first game
Posted: Mon Jan 14, 2013 3:55 pm
by tomshreds
Welcome in the Löve community!
I can tell you that it's one of the most wonderful way of programming a game!
Some says it's good for prototypes only but they clearly didn't get the point. I'm currently developing a whole simulation game based on it (simulation games = many many many calculations at once) and every thing runs smoothly even if I try very hard to make it slow down hehe
Lua is simple, yet different. It's a bit like Ruby but not too much. Array = Tables, keep that in mind.
PRO TIP: Look at the docs before doing anything, I found myself refactoring a lot of code that was already in Lua's code base. (Such as many table functions, go check out table.foreach, table.insert, table.remove, etc).
Hope this helped a bit!
Re: Hi, I'm wondering how to create my first game
Posted: Thu Jan 17, 2013 4:31 am
by ejmr
tomshreds wrote:...go check out table.foreach...
Lua 5.1 deprecates this function and Lua 5.2 removes it completely, so I would not recommend using it, as LÖVE could use Lua 5.2 in the future.
Re: Hi, I'm wondering how to create my first game
Posted: Thu Jan 17, 2013 4:33 am
by tomshreds
ejmr wrote:tomshreds wrote:...go check out table.foreach...
Lua 5.1 deprecates this function and Lua 5.2 removes it completely, so I would not recommend using it, as LÖVE could use Lua 5.2 in the future.
Oh didn't know. Then could you please inform us of what should we use instead? Thanks
Re: Hi, I'm wondering how to create my first game
Posted: Thu Jan 17, 2013 5:40 am
by ejmr
tomshreds wrote:Oh didn't know. Then could you please inform us of what should we use instead? Thanks
My understanding is that the Lua developers dropped table.foreachi in favor of
Code: Select all
for key,value in ipairs(table) do … end
Certainly it is more verbose, but the core Lua team is extremely conservative when it comes to adding new features or expanding the standard library. In fact, it was a long time before Lua even got a for-loop because the developers claimed that while-loops were good enough.