Since my lua programs doesn't work on windows, i'm temprorarely tring on linux!
i made a little game where you have to escape an enemy, i'm trying to add bullets but sadly,
my game started to glitched out when i started to split the files in differents .lua files to organize a little bit
the game.
the glitch is that the player character is very slow and i don't know why beacause the enemy is as fast at it was
before i splited the file
(EDIT) the scancode don't work either.
there is the game file.
(EDIT) changed the game file.
Very slow character
Very slow character
- Attachments
-
- contents.love.zip
- (25.91 KiB) Downloaded 173 times
Last edited by Pospos on Tue Jun 20, 2017 12:56 pm, edited 1 time in total.
Re: Very slow character
Would you be so kind to attach a .love file?
Re: Very slow character
Done. The file is now a .love file runnable on windows.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Very slow character
Not according to the link in your first post it isn't. (You just renamed the folder to contents.love)
You'd need to put the contents in the folder into a new archive file (a zip file, to be precise), save that, and share that... though google drive auto-zips folders when you download them, so
Also, to attach the .love to your post, just drag it into the text area when you're writing a new one, and it'll be attached; Nick meant that, and it's better that way since it won't rely on 3rd party hosts (not that google drive will disappear soon, but still)
Edit: I looked at the project; i have no idea why you have an extra main.lua in your lib folder, but the issue is most probably that you forgot to multiply each something = something + speed with dt.
That would make movement speeds and everything consistent everywhere.
You'd need to put the contents in the folder into a new archive file (a zip file, to be precise), save that, and share that... though google drive auto-zips folders when you download them, so
Also, to attach the .love to your post, just drag it into the text area when you're writing a new one, and it'll be attached; Nick meant that, and it's better that way since it won't rely on 3rd party hosts (not that google drive will disappear soon, but still)
Edit: I looked at the project; i have no idea why you have an extra main.lua in your lib folder, but the issue is most probably that you forgot to multiply each something = something + speed with dt.
Code: Select all
x = x + v * dt
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Very slow character
i have changed these
into these
but now my character doesn't even move.
Code: Select all
player.x = player.x -player.speed
Code: Select all
player.x = player.x - player.speed * dt
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Very slow character
That's because, as you said, your character moved very slow to begin with.
if the player.speed is 100, then 100*dt means move 100 pixels per second; you have the speed variable set to 2, and 2 pixels/second is slow.
if the player.speed is 100, then 100*dt means move 100 pixels per second; you have the speed variable set to 2, and 2 pixels/second is slow.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Very slow character
i set the player.speed to 100 but that's still very laggy though.
The character looks disgustingly laggy, it looks like it 3 fps.
Do you have another solution?
is it possible to set a smaller delta time to, like, 0.01 sec, this way, the character will still look decent.?
The character looks disgustingly laggy, it looks like it 3 fps.
Do you have another solution?
is it possible to set a smaller delta time to, like, 0.01 sec, this way, the character will still look decent.?
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Very slow character
dt should be around 1/60 if vsync is on, and 1/1000 if it's off... i haven't looked too much into your code though.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Very slow character
Are you sure this is the only way to lower dt?
Beacause this bool set to true or false it's the same thing.
Beacause this bool set to true or false it's the same thing.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Very slow character
Yes, that one.
Also it's -not- the same thing.
If it is, then either your drivers are messing something up, or your code is wrong... sadly i dont have more time looking into it, maybe someone else will.
Also it's -not- the same thing.
If it is, then either your drivers are messing something up, or your code is wrong... sadly i dont have more time looking into it, maybe someone else will.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests