ERROR

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: ERROR

Post 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.
Kurosuke needs beta testers
madbaho
Prole
Posts: 4
Joined: Sat Mar 12, 2011 11:03 pm

Re: ERROR

Post 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.
GloryFish
Prole
Posts: 19
Joined: Tue Jan 11, 2011 4:43 pm

Re: ERROR

Post 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.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: ERROR

Post 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...
When I write def I mean function.
User avatar
slime
Solid Snayke
Posts: 3170
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: ERROR

Post by slime »

Perhaps for things unrelated to game programming/scripting. ;)
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: ERROR

Post 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. :ultrahappy: (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.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests