gdkid
Member
Hi guys
I'm having the problem with making a ball bouncing off a circle line
I attached my screenshot so you can get my point.
So the white circle is created using draw_circle
I'd like to make the yellow ball bounce off the circle line, but since it doesn't have a mask, I found it difficult to do so.
Here's the code that I come up so far
I checked the area outside the circle, when the ball collides with this area then it will bounce back
But it doesn't seem to work, since the ball just comes through the circle line.
Thanks in advance for your help
I'm having the problem with making a ball bouncing off a circle line
I attached my screenshot so you can get my point.
So the white circle is created using draw_circle
I'd like to make the yellow ball bounce off the circle line, but since it doesn't have a mask, I found it difficult to do so.
Here's the code that I come up so far
I checked the area outside the circle, when the ball collides with this area then it will bounce back
But it doesn't seem to work, since the ball just comes through the circle line.
Code:
if(!collision_circle(room_width/2,room_height/2,global.radius,objBallParent,false,false))
{
direction += 360-(direction*2)
}
Attachments
-
22.2 KB Views: 13