How to drag different objects one at a time in a mobile game

I am making a 2d game named as car jam in which we have to unlock our car by dragging different objects in either x or y axis for making way for the main game but I am unable to make a script for the movement of these cars the reference game is this “https://play.google.com/store/apps/details?id=com.techarts.car.parking.jam.escape.unblock