I've been learning Lua/Love for the past few weeks but I've hit an impasse. I have a prototype of a simple game that works almost how I want, but I'm now trying to implement a menu system as well as a few other things but I'm going round in circles. I get this error:
Error
main.lua:139: attempt to call method 'getWidth' (a nil value)
Traceback
main.lua:139: in function 'update'
[C]: in function 'xpcall'
which is referring to this section of code:
The attachment lovescreen.png is no longer available
I know I need to change something to do with getWidth but I can't see what. I've also attached a .love file to this post in the hope that someone can delve into it and help me out.
Thanks! After some poking around I managed to get it to work. Now I just need to figure out how to pause the game, have a box appear with a question pulled from the database and have 'True' and 'False' buttons...
paused = false
if paused then
--All the game updating shit goes here
end
Then use the same paused boolean to determine if the box should appear. There's plenty of GUI libraries available for buttons and such. Or you can make your own.