mine explosion physics

0 favourites
  • 6 posts
From the Asset Store
200+ Unique, Single-Frame Explosion sprites! This is the ultimate explosion sprite bundle!
  • Hello,

    when a ball object fell down on a mine (bomb) object I would like that ball to be thrown away because of that explosion...

    how to do that? cant figure it out...

    thx

  • Got a little carried away with it all. So let me know if I need to make it more simple :-)

    .capx

    You can disable/enable the mine to see the difference.

    Basically I apply an impulse to the ball when it collides with the mine.

    Hope it helps.

  • cvp

    thats what I was looking for... thank you man

  • cvp

    man one more question, whenever the ball hit the mine it always throw the ball to the right

    when the ball hit that mine from the left side I would like that ball to be thrown to the left...

  • I have modified the example a bit.

    .capx

    I have changed it to impulse at angle instead.

    And if you use:

    angle(0,0,ball.physics.velocityx,ball.physics.velocityy) you will get the current angle of the ball.

    Then i deduct 180 degrees to get the opposite direction.

    I played a bit around with the impulse speed. you can set that to what you want.

    In the example I have set it to be dependent on the speed with witch it hits the mine. (by using distance instead of angle)

    But play around with it and see what works for you.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • excellent...thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)