if (movetype == 1) movetype = 0; speed = movespeed; direction = nextdir;