Page 1 of 1

I need help.

Posted: Fri Jan 13, 2012 9:43 pm
by Ethan
I'm new to Love, as well as lua. I'm trying to learn from the tutorials on the wiki, but i have a problem. I'm trying to do this tutorial: http://love2d.org/wiki/Tutorial:Hamster_Ball
I did everything that the wiki told me to, but whenever I try to run it i get this:

Error
Could not open file hamster.png. Does not exist.
Traceback
[C]: ?
[C]: in function 'newimage'
main.lua: 2: in function 'load'
[C]: in function 'xpcall'

I'm not exactly sure why it isn't working. Please help.

Re: I need help.

Posted: Fri Jan 13, 2012 10:10 pm
by Robin
Did you download the hamster image, place it in the same directory as the main.lua and rename it hamster.png?

Re: I need help.

Posted: Fri Jan 13, 2012 11:39 pm
by Ethan
Robin wrote:Did you download the hamster image, place it in the same directory as the main.lua and rename it hamster.png?
Yes, I did. However I notice that when I have it selected, although it is named hamsterr.png, it shows it as a "Paint Shop Pro Photo X2 Image". It seems like it should be a PNG file, right?

Re: I need help.

Posted: Fri Jan 13, 2012 11:41 pm
by Ellohir
If you are working on windows and have the "hide known extensions" default option on, you may have renamed the file to "hamster.png.png". So you read "hamster.png" but only because Windows hides the known ".png" extension.

Re: I need help.

Posted: Fri Jan 13, 2012 11:50 pm
by bartbes
Ethan wrote:although it is named hamsterr.png
Your code references to hamster.png, not hamsterr.png.

Re: I need help.

Posted: Fri Jan 13, 2012 11:53 pm
by Ethan
Ellohir wrote:If you are working on windows and have the "hide known extensions" default option on, you may have renamed the file to "hamster.png.png". So you read "hamster.png" but only because Windows hides the known ".png" extension.
Ok, it works now thanks. I'll keep that in mind in future programs.