Page 2 of 2
Re: ERROR
Posted: Sun Mar 13, 2011 9:34 am
by tentus
crow wrote:tentus wrote:Some general advice:
- Indent. I've attached a .love which has marginally improved indentation. It'll help you keep track of where you are and what you're doing in your code.
- Use
PO2 images so that computers that can't render them will still be able to play.
- Don't require anything more than once. One, its not doing anything code-wise, and two, it encourages bad coding habits. Only require class once.
- Comment everything that isn't self evident. I will often put the
why in my comments, like this:
Code: Select all
player.y = player.y - 32 -- Move up by 32 so that the next update doesn't also collide
I've attached a .love (the preferred format for distributing code around here) with some adjustments based on the advice above. Good luck!
your demo give me a error when i hit space bar was that meant to be a error demo ?
Good catch, I didn't check to see if he defined the functions he calls.
Tip #5: define functions before calling them. I do this even when I'm writing the code, just to make sure I don't forget.
Re: ERROR
Posted: Sun Mar 13, 2011 3:28 pm
by madbaho
Thank you all so much. This language is interesting. I self taught in PHP, I did my capstone on php and sessions. A professor encouraged me to learn this as my 2nd scripting language. This language is def interesting. It is so short and effective it is scary. I see some posititve attributes about using this language, especially as a scripting language. I am going to play with some functions and try to do more with this.
Re: ERROR
Posted: Mon Mar 14, 2011 8:51 pm
by GloryFish
It is so short and effective it is scary.
This is a great quote. I spend time in many languages and the thing that always strikes me about lua is how much you can get done with a small amount of code. You are doing yourself a great service by learning it. It will make you a better programmer.
Re: ERROR
Posted: Tue Mar 15, 2011 12:37 am
by kikito
GloryFish wrote:It is so short and effective it is scary.
This is a great quote.
Indeed. A great quote for a great language.
And yet, I must point out that there are more short and effective languages out there...
Re: ERROR
Posted: Tue Mar 15, 2011 1:21 am
by slime
Perhaps for things unrelated to game programming/scripting.
Re: ERROR
Posted: Tue Mar 15, 2011 3:50 am
by BlackBulletIV
kikito wrote:GloryFish wrote:It is so short and effective it is scary.
This is a great quote.
Indeed. A great quote for a great language.
And yet, I must point out that there are more short and effective languages out there...
I know what you're thinking. Ruby
. I was going to say the same thing, but I thought not. I can talk equally long on what I do and don't like with Lua.
(And I could talk for ages about what I like with Ruby... but that's another matter)
slime wrote:Perhaps for things unrelated to game programming/scripting.
Yes, that is the one thing I don't like about Ruby and like about Lua. Speed for intense applications like games.