Bubble shooter: ball colisions placement

Get help using Construct 2

Post » Fri Jan 18, 2013 11:37 am

Hello there,

does anybody have experience with that?

The problem: how to calculate precise bubble position on the hex-grid?

What I already tired:
1) Bullet behavior: on collision with bubble, position at y-1 of the collided bubble. This works but not always and not precise.

2) Trying to calculate the position of the ball before shooting, by drawing a ray, which reflects from vertical walls and than collides with bubbles on the grid. Basically the same problem here, because it is collision dependent.

Any ideas how to solve it without using collision detection?
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Fri Jan 18, 2013 8:22 pm

Here's a bubble shooter test that I made a while back:
http://dl.dropbox.com/u/5426011/examples16/bubble_shoot.capx

It's not complete but it does have the motion, snapping to grid and locating unconnected bubbles implemented.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Fri Jan 18, 2013 8:52 pm

Wow, that's clever - thank you.

So you basically use while loops for moving them -1px back to the right position at an angle until it doesn't overlap anymore and than snap it. Interesting technique.

Man, your logic for locating unconnected bubbles just made me speechless - I would never think this way.
B
42
S
11
G
4
Posts: 505
Reputation: 7,267

Post » Wed Jun 12, 2013 5:36 pm

Hi R0J0hound,

I was trying to take a look from your example but the link is death, could you share it again??

Thanks,
B
15
S
3
G
3
Posts: 5
Reputation: 3,450


Return to How do I....?

Who is online

Users browsing this forum: amarcelo, anty21ro, Magistross and 22 guests