SynfigMaster91 wrote: ↑Fri Dec 15, 2017 7:39 pm
here's the file. It's out there.
Thanks.
Code: Select all
10 if love.keyboard.isDown("right") then
11 10 + 40 * dt
12 end
So you changed all variables to static numbers and also didn't tell lua how it should use the results of your calculations.
How should LÖVE/Lua know what these calculations are for? As result, lua throws an error telling you that there has to be something wrong with your code on line 11 and stops searching for more errors.
Your previous code was fine, and I uploaded a working example showing how the code could look like. So why don't you start with the working example and experiment with it until you understand how the syntax has to look like.
Another problem I've seen is that you tried using colon syntax and self and mixed this with the dot syntax...
Code: Select all
function square:setup()
self.img = love.graphics.newImage('player.png')
self.x = 100
self.y = 100
end
Generally this will be the way to go later, but for now you should avoid using self and the colon syntax and stick with the dot.
As a starting point I would suggest reading a bit more about variables, operators and tables and how they work.
The lua pil is a good source where you'll find answers for almost everything lua related.
Edit - Zorg is right, we won't hand-hold you through every error you get, so please take our advises and try learning the lua language to some extend. It might be hard when you are new and we are willing to help, but most of the errors you got can be solved with just reading and researching what the error handler displays.