Hi, I'm wondering how to create my first game

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
tavuntu
Citizen
Posts: 65
Joined: Mon Dec 24, 2012 6:56 am
Contact:

Hi, I'm wondering how to create my first game

Post 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.
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Hi, I'm wondering how to create my first game

Post 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
User avatar
tavuntu
Citizen
Posts: 65
Joined: Mon Dec 24, 2012 6:56 am
Contact:

Re: Hi, I'm wondering how to create my first game

Post by tavuntu »

Thanks a lot :D I'll check that.
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Hi, I'm wondering how to create my first game

Post 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. :)
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Hi, I'm wondering how to create my first game

Post 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 :)
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Hi, I'm wondering how to create my first game

Post 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.
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Hi, I'm wondering how to create my first game

Post 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!
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Hi, I'm wondering how to create my first game

Post 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.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Hi, I'm wondering how to create my first game

Post 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
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Re: Hi, I'm wondering how to create my first game

Post 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. :)
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
Post Reply

Who is online

Users browsing this forum: No registered users and 59 guests