Lua Learning Sources

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Nart Madi
Prole
Posts: 1
Joined: Sun Jun 12, 2016 8:59 pm

Lua Learning Sources

Post by Nart Madi »

Hello!

I would like to know Lua learning sources so I could start learning Love2D, I would also want to know if I could directly learn Love2D without having knowledge about Lua.

I am a beginner.

Thanks for helping!

Here is my recent project which is called "Button Press Indicator" it tells you which button you toggled on your keyboard to let you know if it is working or not working!
main.lua
(5.87 KiB) Downloaded 181 times
Goats!
Prole
Posts: 2
Joined: Fri Apr 15, 2016 10:19 pm

Re: Lua Learning Sources

Post by Goats! »

Hello!

Beginning Lua Programming by Kurt Jung and Aaron Brown is a wonderful book, I recommend getting it and reading cover to cover first if you need to know Lua.

I use the Google and StackExchange frequently for some quirks in Lua that I run into or some odd thing that I need to know how to do. :P

I also very often take a peek at the projects that other people post on the forums to learn from them. I learned how to make a simple framework or skeleton from which to build a game from some of the examples here, so they are very valuable. :)

There really isn't any way around learning Lua to program in Love2d, sorry to say. You'll be unable to use many of the libraries and won't be able to learn much of anything from the projects other people have done. You just have to do it. :)

Also, your code could be made much more compact using another callback! You should avoid making a ton of if statements if you can and instead think of ways of getting the computer to do all of the work for you and do it neat and efficiently. :P

I hope that helps!

Code: Select all

local text
 
function love.load()
   love.graphics.setNewFont(25)
   text = "Current Key"
   keytext = "Press a Button"
   love.window.setTitle("BPI")
end
 
function love.keypressed(key, scancode, isrepeat)
   keytext = scancode
end

function love.draw()
   love.graphics.print(text, 300, 200)
   love.graphics.print(keytext, 300, 250)
   love.graphics.print("Made By Nart Madi!", 300, 300)
end
Serapth
Prole
Posts: 17
Joined: Mon Jan 25, 2016 5:03 pm

Re: Lua Learning Sources

Post by Serapth »

I did a fairlycomplete Love/Lua tutorial series that could help. The first half is a Lua introduction, then it dives specifically into Love usage.
Post Reply

Who is online

Users browsing this forum: kov_serg and 3 guests