Error creating Hello World game
Posted: Thu Oct 28, 2010 5:42 pm
Dear fellow lovers,
I'm straight out of the blocks, into the first hurdle and BAM!, I have fallen flat on my face. Been googling around, and searched this forum, can't find the solution to my problem.
I've downloaded and installed the latest version of Love for Mac (0.6.2). I can run the bundled demos. However, when I try and create and run my own game I'm seeing the following error :
syntax error: main.lua:2: unexpected symbol near 'Â'
This is the code that I copied from the wiki :
function love.draw()
love.graphics.print("Hello World", 400, 300)
end
To run the game, I'm dragging the folder that contains main.lua onto the Love icon.
I have tried creating the file with both TextEdit and TextWrangler. I suspect this problem may be due the text encoding used to save the file. In TextWrangler I have tried UTF8, UTF16, BOM and no BOM, and a wild variety of other settings in vain. I notice that the unexpected symbol in the error message changes when I change the encoding.
Any assistance would be greatly appreciated.
Patrick
I'm straight out of the blocks, into the first hurdle and BAM!, I have fallen flat on my face. Been googling around, and searched this forum, can't find the solution to my problem.
I've downloaded and installed the latest version of Love for Mac (0.6.2). I can run the bundled demos. However, when I try and create and run my own game I'm seeing the following error :
syntax error: main.lua:2: unexpected symbol near 'Â'
This is the code that I copied from the wiki :
function love.draw()
love.graphics.print("Hello World", 400, 300)
end
To run the game, I'm dragging the folder that contains main.lua onto the Love icon.
I have tried creating the file with both TextEdit and TextWrangler. I suspect this problem may be due the text encoding used to save the file. In TextWrangler I have tried UTF8, UTF16, BOM and no BOM, and a wild variety of other settings in vain. I notice that the unexpected symbol in the error message changes when I change the encoding.
Any assistance would be greatly appreciated.
Patrick