Adding tick function to make the objects move.