Why are you calling love.load twice in a project, and why are you requiring the main file? If those two decisions aren't ringing bells, I don't know what is.
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
Please, upload your code as a .love instead of dumping it directly in your post. Do you know how to do that?
What's with the underscores you start every variable name with? It's ugly, makes your code harder to read and serves no point.
Globals are bad. Don't do it like that. Let _intPlayer return the player table instead of assigning to a global name. For that matter, use arguments. If you had passed dt to _movePlayer as an argument instead of assigning it to the global name _fDT, you would not have had the problem you're having now. And as for that:
You assign dt to _fDTafter calling _movePlayer, instead of before, so the _fDT is still nil the first time you try to move the player.
Robin wrote:Alright, I'm going to be harsh for a minute here:
Please, upload your code as a .love instead of dumping it directly in your post. Do you know how to do that?
What's with the underscores you start every variable name with? It's ugly, makes your code harder to read and serves no point.
Globals are bad. Don't do it like that. Let _intPlayer return the player table instead of assigning to a global name. For that matter, use arguments. If you had passed dt to _movePlayer as an argument instead of assigning it to the global name _fDT, you would not have had the problem you're having now. And as for that:
You assign dt to _fDTafter calling _movePlayer, instead of before, so the _fDT is still nil the first time you try to move the player.
yeah I figured the last one out. thanks i'll uplaod the .love anyway. i'll change the variables later I don't have time right now
Robin wrote:
Wrong 1: requiring modules inside love.load()
Quite curious as to why. Apparently I'm making this "wrong" as well but I have had no issues in doing so.
The only thing I could think of that would cause issues is if functions or variables outside load try and use stuff that isn't required (in memory) yet... but I have already taken that into consideration when writing my modules.
Either that or it is just a minor bad practice which I can understand as well.
Robin wrote:
Wrong 1: requiring modules inside love.load()
Quite curious as to why. Apparently I'm making this "wrong" as well but I have had no issues in doing so.
The only thing I could think of that would cause issues is if functions or variables outside load try and use stuff that isn't required (in memory) yet... but I have already taken that into consideration when writing my modules.
Either that or it is just a minor bad practice which I can understand as well.
I'm wondering this as well. All my modules return their values upon requirement (rather than writing to global variables), so I always thought it made the most sense to put it love.load (or similarly used state.load functions). I would be very interested in knowing any negative aspects of this style.
When you hold eather left or right keys the angle goes past 360 and for some reason when the angle is a high number the movement starts to slow down. Help?