square motion

sounds like you want to quantize the movement. you could use integer variables or use round, floor or ceiling mat. there is also a divide and remainder node that could be useful.