Circle Collision Radius

Get help using Construct 2

Post » Mon Aug 06, 2012 10:28 pm

You seem to already have the answer - just check if the distance between the coordinate you want to check and the center of the object is smaller than the circle radius - if it is, there's a collision.
if you want to check between two circles, the process should be very similar, and extremely simple as well: the distance between the objects should be less than the sum of their respective radii for a collision to happen.

If you need something else, try this:
Collision detection and reaction
it's made for AS3, but one with your knowledge level should be able to port the code easily :)Fimbul2012-08-06 23:07:48
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Tue Aug 07, 2012 7:05 pm

The problem is that it's a physics game entirely made of circle based sprites. That's why i asked. If it were just a simple collision detection of course i code code it myself...
I'll test to see how things go with fake polygon circles. But adding control to circle body is very important imo. Other thing is adding the rest of joints like MouseJoint and adding Kinematic Control.Kiyoshi2012-08-07 19:19:49
B
58
S
13
G
10
Posts: 632
Reputation: 12,515

Post » Tue Aug 07, 2012 7:30 pm

Sounds like you need to put in a request to have some primitives, other than box in the editor.
The question is what other primitives would be useful while not taxing the system too much.

@Ashley might say that an octagon would be too much, where something like an iso square would be about the same.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Tue Aug 07, 2012 8:15 pm

For some reasons I did a square invisible player and pinned some objects on him.

One of them was a circle with Physics behavior, where have that circle collision mask.

I used the circle to smoothly the detection between the player and some physic boxes on the screen.

Following this philosophy, you'll be able to reach what you want mixing it with the other types of collisions in your game, and of course, if you change the sprite size, the circle also change.

A long discussion was made about the circle polygon, on Stencyl community, and the result was No, they didn't implemented it because of the issues around the Hardware usage and performances.

ImageImageImageImageImageImage
B
93
S
20
G
14
Posts: 1,218
Reputation: 19,500

Previous

Return to How do I....?

Who is online

Users browsing this forum: newt and 23 guests