Page 1 of 1
Löve exiting randomly
Posted: Fri Feb 13, 2015 7:39 pm
by XanthicDragon
Hello! I'm relatively new to Love's engine (but EXCELLENT at Lua), and I have noted a problem with my program:
I have a Lua file - Game.lua - that I am requiring within the Main.lua. After I run the Game, I can wait a little while (around 15 seconds), then love will exit. It's not crashing to what I know, because there's no evidence that it is (My mac won't say "Love exited unexpectedly" and there's no Lua error)
Any ideas on what might be happening?
If you want to see the code that I have so far, here it is:
https://github.com/XanthicDragon/L-ve-- ... ree/master
Re: Löve exiting randomly
Posted: Fri Feb 13, 2015 8:47 pm
by davisdude
Well, a lot of your logic is incorrect:
- First of all, you have two love.draw functions:
here and
here.
- You shouldn't define love.mousepressed or any of the other callbacks inside of love.draw, let alone every frame. (
here and
here).
-
This is could be why it's quitting, but probably not.
- You don't need to
clear ever frame- that's automatically done.
- I don't know how you even got it to run, since you aren't using love.update...
- love.draw is not passed any arguments (
here and
here).
I think your problem is because you're calling love.draw, then overwriting it every frame, but I'm not sure. I don't have any of the graphics or sounds, and don't really feel like removing those lines.
Re: Löve exiting randomly
Posted: Fri Feb 13, 2015 8:53 pm
by s-ol
Are you running from terminal? Because you should do that. Then out some debug print's somewhere (especially where that quit call is) and do stuff until it exits.
Re: Löve exiting randomly
Posted: Sat Feb 14, 2015 6:03 pm
by Jasoco
I'd love to help you but as davisdude said, without the graphics and sounds it's very hard. What he said is probably right. There's a lot of awkwardness. It sounds like you're filling up memory rapidly. Use the Terminal like mentioned above. It'll hopefully print an error for you.
Re: Löve exiting randomly
Posted: Sat Feb 14, 2015 9:49 pm
by XanthicDragon
Alright - as I said I am new to Love.
Other than that, I REALLY goofed then, didn't I? Thanks for those notices. I'll have those problems fixed up
Re: Löve exiting randomly
Posted: Sat Feb 14, 2015 10:03 pm
by XanthicDragon
OK - After organizing my code, I haven't had any crashes. Thanks for helping me with those mistakes.
Re: Löve exiting randomly
Posted: Sat Feb 14, 2015 10:19 pm
by davisdude
Let us know if you need any more help!