objects spawning following the touch event.x.y , possible ?

Hi,

I was wondering if I have an object as block, is there any possible way to make the object spawn following my finger ?so I can make walls for defense against the enemies attack ? and can I control the number of the objects that will be spawned, I don’t want them endlessly

thanks