hi ,
i’m trying to draw an empty circle that act like a circular boundary for objects (balls), i used an img for a circle and then used collision to forbid the balls from passing that circle boundary … the problem is :
the balls collide with the whole circle img even the transparent part and go out the whole area , so i used draw points using the circle formala and got forced to draw the empty circular boundary point by point . Is this the only solution to draw circular boundary ?
this is the code i used
[lua][code]
nq = 160 --diameter of the circle
x = 0 – the start point of the circle
xd = 0
–the upper half of the circle
for i = 0 ,320 do
k = x^2-320*x+57600
y = (nq*3 - ((nq*3)^2 -4*k)^(1/2) )/2
cir = display.newCircle (x,y,4)
x = x+1
end
–the lower half of the circle
for i = 0 ,320 do
k = xd^2-320*xd+57600
y = (nq*3 + ((nq*3)^2 -4*k)^(1/2) )/2
cir = display.newCircle (xd,y,4)
xd = xd+1
physics.addBody (cir,“static”, {bounce=0., density=1.0,} )
end
[/code][/lua]
[import]uid: 96650 topic_id: 21969 reply_id: 321969[/import]
