Ah, my mistake. I wasn't clear enough. I'm not trying to repeat the same object many times. I would like to know how to create a sprite that will mimic obstacles' shapes like a dotted circle here youtube.com/watch
Ho, I see,
Interesting mechanics I have never seen before.
To be honest I will keep it simple as it will be very easy to hurt performance if you are not very careful as you have many balls to check on.
I quick and simple idea that comes to my mind will be something like this:
Demo:
https://www.dropbox.com/s/fglaium14kq2jd8/1-Batty%20Cave.capx?dl=0
You can keep updating and tweaking to your needs, this is just a quick demonstration.
Tips:
1-You would want to keep the shapes simples (Squares, Rectangles, Circles, triangles) shape that you can easily adjust the collisions points.
But if you need more advance then kyatrics idea will be better to detect the collisions.
2-Donot spawn too many balls so you can keep performance nicely.
3-On this demo the obstacles are already placed on the layout as I wanted to make a quick concept but what you would want to do is like flappy birds style that keeps spawning the obstacles on the fly, this way you will keep the object count at the minimum, so set a set of obstacles to be spawn on the runtime and then just choose randomly.