You can do it in moveEvent() Recursion won't be infinite if you provide a stop condition.