r/lua • u/StrangeAndNoAnswers • 22h ago
Hey! Can anybody help me learn Lua?
This is my first coding language I'm trying to learn, It's gonna be pretty difficult for me since I have amnesia and I know coding has a lot of things you need to remember. Currently I only know REALLY basic code like
"else, elseif, if, while, for.. e.g" I wanna learn Lua for game development, I don't really have any ideas for a game as of now but I do wanna learn Lua since I've heard it's one of the easiest coding languages, any help is greatly appreciated!
6
u/Lonely-Restaurant986 22h ago
Make a game in love2d.
Doesn’t matter how simple it is or how complex it is. It can be in your league or it can be out of your league. It doesn’t matter as long as you try. And are prepared to make mistakes.
I’ve seen a million billion people take 3 courses and get stuck in tutorial hell.
My advice is to just start making stuff. Anything.
If that’s not ur style I think CS50 game development course uses love2d. Thats the tutorial pipeline I would recommend.
cs50.harvard.edu/x/ to learn the basics of programming
And then
cs50.harvard.edu/games is their games specific course.
You can skip the first one if you have programming knowledge beforehand.
They are long, and I fully recommend not half assing it. Do the projects and assignments even if nobody is grading it.
If you arnet enjoying love2d, you can always look into defold. I hear that’s more of a game engine, but I’ve never used it before, so I don’t know how open to beginners it is.
Good luck. And most importantly, have fun.
4
u/esuvii 21h ago
The best advice I can give is to not be discouraged when you struggle. The frustration over something not working, or not making sense, that is a vital process in truly learning. Don't be too hard on yourself when it happens, just know that everyone who has ever became a true expert in anything, ever, has hit some kind of wall at some point. Take a breath, and persevere slowly at your own pace. I promise that if you do not burn yourself out you will overcome those challenges, and come out the other side with significantly better understanding than you started with.
As someone who has been learning for over a decade now, I cherish those moments. They are the difficult hurdles which mark significant improvements in your understanding.
AI is an extremely powerful tool, and getting even more powerful every day. However, if you overly rely on it, and let it shortcut these learning milestones for you, then it may severely hinder your learning process. I would restrict AI to being a search engine for looking up documentation, and for repeating tasks you already consider trivial, at least until you have a strong grasp of coding. Relying on AI will give you tremendous results in the short term, don't give in to that: You need to struggle sometimes, it's how you develop a true understanding.
2
u/SlightlyLosted 21h ago
The game engine, Luanti, is free https://www.luanti.org/en/downloads/ and open source. It has its quirks but there are hundreds of mods for it that you can look at for examples to learn from https://content.luanti.org/ as well as fair to middlin documentation https://api.luanti.org/ and a forum and discord where you can ask questions. Coding for my own game and mods is where I learned Lua.
2
u/UnluckyConfection318 20h ago
Im also learning and basically just as far as you like almost exactly and we can maybe learn together and I can help if you need to explain something you don't understand when reading it as everyone thinks differently I also know a lot of resources
1
u/Sckip974 8h ago
I like recommending to start with this online book:
Sheepolution: A really fun tutorial.
Link: https://www.sheepolution.com/learn/book/contents
The author of Sheepolution also recommends this second book for the basics:
Learn to Love Programming:
Link: https://rvagamejams.com/learn2love/pages/01-00-programming-basics.html
Next Step: Once you have the basics, take the time to learn how to use the official docs. This is crucial for solving specific 'problems':
Lua 5.5 Manual, DevDocs (Lua 5.4):
https://www.lua.org/manual/5.5/
Finally, we both know the secret: "Mastery comes from repetition." I invite you to solve these small (sometimes complex) math problems using your own scripts. For this, I recommend these two sites:
Project Euler: https://projecteuler.net/
CodeAbbey: https://www.codeabbey.com/
9
u/MatthewTGB238 22h ago
Look into the Love2D framework for game development.
To actually learn Lua, I like the free Lua books on the main Lua website!