Create a code to move a sprite on a grid to three targets. Include a sequence code and try to incorporate a loop and/or a conditional statement.