Hello, I'm fairly new to programming (I'd say I have like 2 weeks actually using lua and like 2 months of starting to read PIL) and so I started to make some sort of game (which doesn't really involve updating too many frames which is why I'm looking for a way to cap the fps to 30ish).
Anyway, I got the Menu screen down and the variables it should return to actually start the game, but I added a function (found in healthreward.lua) that I wanted to test, but whenever when I call it (Pressing "H" while on the play screen) LOVE will just freeze and crash. That's the only way to replicate the crash and I don't seem to figure out why it does that.
The code doesn't really use complex stuff because I'm not really too good neither experienced.
Sorry if I missed any points, but any help is greatly appreciated.
Here's the link to the .love file:
https://www.dropbox.com/sh/7wx1z6rxuxvu ... kINza?dl=0
Game freezes and crashes after menu if I call a function
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 2
- Joined: Fri Mar 13, 2015 11:55 pm
- Location: MX
- Contact:
Game freezes and crashes after menu if I call a function
"Once confirmed, it can't be denied." - A friend of mine who talks when he sleeps.
Re: Game freezes and crashes after menu if I call a function
Because there is the "while" loop that only stops when "setstate" is set to something other than "hpreward".PeanutCarl wrote:Hello, I'm fairly new to programming (I'd say I have like 2 weeks actually using lua and like 2 months of starting to read PIL) and so I started to make some sort of game (which doesn't really involve updating too many frames which is why I'm looking for a way to cap the fps to 30ish).
Anyway, I got the Menu screen down and the variables it should return to actually start the game, but I added a function (found in healthreward.lua) that I wanted to test, but whenever when I call it (Pressing "H" while on the play screen) LOVE will just freeze and crash. That's the only way to replicate the crash and I don't seem to figure out why it does that.
The code doesn't really use complex stuff because I'm not really too good neither experienced.
Sorry if I missed any points, but any help is greatly appreciated.
Here's the link to the .love file:
https://www.dropbox.com/sh/7wx1z6rxuxvu ... kINza?dl=0
That is only changed when "c" is pressed, but that won't work because the keys will never get updated when your love.update keeps spinning.
That's why in löve (and wherever else there are per-frame-update-functions) you do not have "blocking" loops in those parts of code: Never wait for user input!
Also, please attach the .love in the post and not on dropbox. There's a feature for that.
-
- Prole
- Posts: 2
- Joined: Fri Mar 13, 2015 11:55 pm
- Location: MX
- Contact:
Re: Game freezes and crashes after menu if I call a function
Thanks, that sounds pretty logical. And I tried to upload the .love as an attachment but the browser would just return a timeout error everytime I try, perhaps I have to update it, will do next time.
"Once confirmed, it can't be denied." - A friend of mine who talks when he sleeps.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests