# Moving problem

**URL:** <https://forum.kirupa.com/t/moving-problem/247464>\
**Category:** programming\
**Created:** [December 24, 2007, 2:39am UTC](https://forum.kirupa.com/t/moving-problem/247464 "2007-12-24T02:39:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsukimaru](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@Tsukimaru](https://forum.kirupa.com/u/Tsukimaru)\
**Post date:** [December 24, 2007, 2:39am UTC](https://forum.kirupa.com/t/moving-problem/247464/1 "2007-12-24T02:39:41Z")

</div>

I’m having trouble programming the walking sequence for my character. This is what I want:

When you press the down key, he moves down 48 pixels, but only one pixel at a time, so even if you release the down key before he moves all 48 pixels, he keeps moving until he’s gone the entire length.

This is because I’m making a tile based game, and I don’t want him to be able to stop in between tiles (my tiles are 48 x 48 pixels).

Can anyone explain how to do this? I tried using a for loop, but I’m not good at those and it didn’t work out.
