Jump to content


Photo

Move_bounce_all(1)


  • Please log in to reply
5 replies to this topic

#1 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4113 posts
  • Version:GM6

Posted 06 December 2008 - 08:34 AM

Hi. Is there a way to stop objects from getting stuck when two moving objects try to bounce off of each other?

For example, if there is a moving wall, and a ball collides with it, they will both get stuck and not move. Is there a way to prevent this bug from happening?

Posted Image
Bounce Movement Example.gmk

The code I am using:

OBJECT: ball - EVENT: collision (wall)
move_bounce_all(1)
OBJECT: wall - EVENT: create
hspeed=3
That's all there is to it. The wall has no collision event with the ball. Am I missing something incredibly simple?

Thanks.

Edited by stubbjax02, 06 December 2008 - 09:34 AM.

  • 0

#2 Catalyst23

Catalyst23

    GMC Member

  • New Member
  • 72 posts

Posted 06 December 2008 - 09:06 AM

Jeez, I dunno.

Maybe try stopping the wall moving just before the collision, then continue after the bounce?

Or are you trying to get both objects move off in a different direction?
  • 0

#3 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4113 posts
  • Version:GM6

Posted 06 December 2008 - 09:33 AM

Jeez, I dunno.

Maybe try stopping the wall moving just before the collision, then continue after the bounce?

Or are you trying to get both objects move off in a different direction?

I'm only wanting the ball to bounce off, not the wall. I can't make the wall stop otherwise it would look really weird, if not worse than the ball getting stuck. Here, I made an example of what I mean: Link
  • 0

#4 King Killa

King Killa

    <-- ?Which Way? -->

  • New Member
  • 572 posts

Posted 06 December 2008 - 09:52 AM

The problem, I believe, is this:
When the ball goes to execute the bouncing action, as you've used move_bounce_all, it starts to bounce however because it starts bouncing while in different areas of the paddles, does many tiny bounces until the paddle passes through it all together.

Here is the fixed version of the example you provided:
http://willhostforfo...ad&fileid=43820

Making the paddle solid and using move_bounce_solid(1) enables the ball to bounce away straight away, as the paddle is solid and does not allow the ball to pass through it (as it does with the code you used) when it decides to bounce.

Oh, sorry! I forgot to make the ball solid. You'll need to do this to ensure smoothness with the bouncing. Though, this is easy enough for you to do yourself. :blink:

Edited by King Killa, 06 December 2008 - 10:01 AM.

  • 0

#5 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4113 posts
  • Version:GM6

Posted 06 December 2008 - 10:20 AM

The problem, I believe, is this:
When the ball goes to execute the bouncing action, as you've used move_bounce_all, it starts to bounce however because it starts bouncing while in different areas of the paddles, does many tiny bounces until the paddle passes through it all together.

Here is the fixed version of the example you provided:
http://willhostforfo...ad&fileid=43820

Making the paddle solid and using move_bounce_solid(1) enables the ball to bounce away straight away, as the paddle is solid and does not allow the ball to pass through it (as it does with the code you used) when it decides to bounce.

Oh, sorry! I forgot to make the ball solid. You'll need to do this to ensure smoothness with the bouncing. Though, this is easy enough for you to do yourself. :blink:

Oh I see now! That was quite an easy question, I guess. Thank you very much for the help, King Killa.
  • 0

#6 King Killa

King Killa

    <-- ?Which Way? -->

  • New Member
  • 572 posts

Posted 06 December 2008 - 10:22 AM

No problem, glad I could help.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users