[Resolved] Collision mask is displaced

For questions about using Classic.

Post » Mon Apr 18, 2011 12:44 pm

I'm creating a game where a ball flies up, colliding different objects. Objects give the ball speed, if ball is too slow it falls down. I use custom movement behaviour for the ball.

The problem is that when the game just starts - collision detection works fine, but the more game continues the more collision mask displaces down, relative to the ball.

It looks like when the ball (black) overlaps an object - nothing happens, but when it flies above the object - collision event happens.

[url:15gz8qpq]http://img69.imageshack.us/img69/2531/ballbug.jpg[/url:15gz8qpq]
On the screenshot above you can see a moment, when displaced collision box has just touched a button, and little stars particles spawned. The spawn point is much lower that the sprite.

If anyone has met this problem - i would appreciate your help!
i can send you a .cap file, though it's quite big and complicated.

P.S. Construct is great!

Added .cap:
[url:15gz8qpq]http://yemsalat.org/uploads/download.php?gname=7950BounceBall.cap[/url:15gz8qpq]
B
1
G
1
Posts: 5
Reputation: 435

Post » Tue Apr 19, 2011 4:34 am

I've never had collision detection issues like that.
How are you checking for collisions? Are you using "overlaps at offset" at all?
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Apr 19, 2011 8:51 am

[url:1r2xgm5q]http://img12.imageshack.us/img12/1832/ballbug2.jpg[/url:1r2xgm5q]
I use "Object is overlapping object". But "Overlapping at offset" gives same effect.
B
1
G
1
Posts: 5
Reputation: 435

Post » Thu Apr 21, 2011 7:46 am

The problem is still there... Maybe anyone seen a similar topic with any suggestions? Not sure if this is Construct bug, or my own error.
B
1
G
1
Posts: 5
Reputation: 435

Post » Thu Apr 21, 2011 10:22 am

If you post the cap, someone should be able identify if it's a bug or logic problem. At least it's the easiest and fastest way to get a solution.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Fri Apr 22, 2011 7:57 am

[url:3o2sqqq8]http://yemsalat.org/uploads/download.php?gname=7950BounceBall.cap[/url:3o2sqqq8]
Most of the collision events are in "BounceStar" group.
All the movement is defined in "InfiniteMovement" group.

If you have any suggestions on code or game improvement - they will be highly appreciated!
B
1
G
1
Posts: 5
Reputation: 435

Post » Sat Apr 23, 2011 10:43 am

If you move the "Infinite movement" group above The "BouceStar" group the collisions are spot on.

I think the issue was the ball's y position was being set after the collisions were detected, and it wasn't quite lining up with your logic.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Apr 25, 2011 12:59 pm

Thanks! It worked! Thank you very much again.
B
1
G
1
Posts: 5
Reputation: 435


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest

cron