if (dir_change) step_acc= (1/2 step, for whichever direction we're now headed in) ... if (step_acc > addval) { step_acc -= addval; // keep track of our 1/2 "pseudo-step) accum -= addval; if (step should have happened) set a flag } else { step_acc=0 (was going to go to 0 anyway) deal with accum as normal } ... when doing the step, the check should be if (step_flag && !step_acc) { step }