ID:138974
 
Code:
Download

Problem description:
When I press and hold arrow key:
1. First step is smooth
2. Second step is much faster, nearly instant
3. All further steps are fine

Is this a problem with my code, or that's how movement is handled? Is there any way to make second step smoother, to make it look continuous?
Try fiddling with pixel_step_size. It determines how many pixels your icon will move, per tick, when changing positions between tiles. Usually it's set to 0, which fluctuates depending on how you hold the key down.

I find that 16 gives me a fairly consistent movement speed, but it depends on how you have your movement set up. (multiples of 2 work best)
In response to Bravo1
Moreso than multiples of 2, I think factors of world.icon_size are the best.
In response to Complex Robot
Yes, that's probably best. The only problem is that when moving diagonally, it'll get choppyn since in terms of pixels, you are moving further. I've tried it out myself and unless you use 0, either diagonal or straight movements will look choppy, though, diagonals aren't used very often so it may as well not even matter.
In response to Bravo1
pixel_step_size = 6 is too much, pixel_step_size = 4 is perfect, but problem persists 0.o.
In response to Zaoshi
Well, there is a standard delay that is built into byond. The first step is at normal speed and then the second step and onward are repeated.

You should probably look into a library that moves based on whether the key is up or down, rather than if the key is repeating.

What do I mean by that? You know that small delay that you get when you hold down a key when typing. it types the letter once, then it waits about half a second and then types the letter super fast over and over again? Same thing. There are some movement systems that use the default byond movement but instead of calling procs like North() they call step(src,north) instead with some switches involved in it. It basically makes your movement respond instantly instead of taking the keyboards repeat delay into account.