Löve exiting randomly

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
XanthicDragon
Prole
Posts: 7
Joined: Fri Feb 13, 2015 7:30 pm

Löve exiting randomly

Post 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
"rawr ecksdee" --Xan the Dragon

Baby Inspector is best inspector. No exceptions.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Löve exiting randomly

Post 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.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Löve exiting randomly

Post 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.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Löve exiting randomly

Post 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.
User avatar
XanthicDragon
Prole
Posts: 7
Joined: Fri Feb 13, 2015 7:30 pm

Re: Löve exiting randomly

Post 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 ;)
"rawr ecksdee" --Xan the Dragon

Baby Inspector is best inspector. No exceptions.
User avatar
XanthicDragon
Prole
Posts: 7
Joined: Fri Feb 13, 2015 7:30 pm

Re: Löve exiting randomly

Post by XanthicDragon »

OK - After organizing my code, I haven't had any crashes. Thanks for helping me with those mistakes.
"rawr ecksdee" --Xan the Dragon

Baby Inspector is best inspector. No exceptions.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Löve exiting randomly

Post by davisdude »

Let us know if you need any more help! :D
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 7 guests