Some Background Info:

Ok, I've made a small mario game, and I've got a weeeee bit of a problem. At the main screen, mario is pointing at one of two selections: Play, or Quit. What quit does is obvious, but when mario points at play and the user presses the return key, I want the play sprite to move across the screen until it is off screen and have a Load Game button slide back to the right so the user can pick which load game (again, mario points to the one the user selects.)

Now, for my problem:
What I did to animate the Play button is at every Game Cycle (i made my game to run at 50fps) the program checks if a variable, iAnimating is equal to 1 or 2 (1 means the play button should move to the left, 2 means the load button should move to the right). Then it calls the AnimatePlayButton() function that i created. This just sets the playbuttons x value to a little less than before so that it moves a few pixels left across the screen at every Game Cycle while iAnimating is equal to 1. Then when the button reaches a certain x value (-77 to be exact), iAnimate = 2 and the LoadGame button starts moving to the right. It is a very weird problem, but for some reason the objects stop moving unless I keep the return key pressed, or any other key for that matter. (eg, i press return and release it, then the button moves a little. to make the animation keep playing i have to keep any key pressed). Here are some code snippets for you so you know what I mean:

this function is called every cycle:
void HandleKeys(HWND hWnd)
{
if (GetAsyncKeyState(VK_ESCAPE) < 0)
SendMessage(hWnd, WM_DESTROY, 0, 0);
if (iLevel == 2)
{
if (GetAsyncKeyState(VK_RETURN) < 0)
{
if (SelectMode == 1)
{
iAnimating = 1;
iStartScreenMode = -1;
}
and so on so forth, the rest of the function is irrelevant. the iStartScreenMode is set to -1 so that mario cant move his arms during the animation. SelectMode just checks if mario is pointing at the Play button and not the Quit button when return is pressed.

this is the game cycle that calls the animation:

void GameCycle(HWND hWnd)
{
InvalidateRect(hWnd,NULL,false);
if(iAnimating != 0)
AnimatePlayButton();
}

and heres the AnimatePlayButton function:

void AnimatePlayButton()
{
if (iAnimating == 1)
{
if (PlayQuit.x > -77)
PlayQuit.x = PlayQuit.x - 10;
if (PlayQuit.x <= -77)
{
SelectMode = 3;
Load12.x = -210;
iAnimating = 2;
}
}
if (iAnimating == 2)
{
if (Load12.x < 108)
Load12.x = Load12.x + 10;
if (Load12.x >= 108)
{
iStartScreenMode = 1;
iAnimating = 0;
}
}
}


I know this problem is extremely confusing putting it lightly, but if there are any programmers who see my mistake PLEASE post here, I'm completely stumped :( (I bet it's just a stupid mistake but I can't spot it)

If you would like the full code for the game beginning, and are willing to take on the challenge email me at:
f4cepl4nt@hotmail.com
and I will send you my code so far..but just a note, I'm not going to send you the bmps I used because they are far too large.

THANKS A MILLION :) :) whoever helps will definitly get credit.