The Daily Click ::. Forums ::. Klik Coding Help ::. Physics Issue? (.MFA provided)
 

Post Reply  Post Oekaki 
 

Posted By Message

J.C



Registered
  22/03/2013 05:18:14
Points
  118
4th October, 2015 at 04/10/2015 03:49:48 -

Hi. I seem to be having trouble figuring out how to code it so that the throw-able daggers break when they hit a wall and then stop moving when they hit the ground.

The way I have it set up now is that when the dagger hits the wall, the dagger object is destroyed, then that creates two broken pieces of the dagger to be created, which then are supposed to bounce off the wall, then become static when they hit the ground.

The main problem here is that when the player throws the daggers (with X key) most of the time the daggers get stuck in the wall, which is a neat effect, but not exactly what I intended.

Any hints and help is appreciated.

I have provided an mfa file for your convenience. Please look at the frame LVL 4. The dagger collision code begins at line 45.

https://www.dropbox.com/s/nqs40q6m0x3idjv/Throwable%20Dagger%20Test.mfa?dl=0

Edited by J.C

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
7th October, 2015 at 07/10/2015 17:24:55 -

Ok easy fix.
First double click on the check mark here:

Image

Then rearrange the actions like so:

Image

The reason this works is because you need to set the movement first before you set the direction. If you set the direction first then change the movement the new movement's default directions will override your direction change action.

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
7th October, 2015 at 07/10/2015 21:37:50 -


Originally Posted by -UrbanMonk-
Ok easy fix.
First double click on the check mark here:

Image

Then rearrange the actions like so:

Image

The reason this works is because you need to set the movement first before you set the direction. If you set the direction first then change the movement the new movement's default directions will override your direction change action.



Ah, never realized that was the case. Thanks again UrbanMonk.


 
n/a

nivram



Registered
  20/07/2006
Points
  171
14th October, 2015 at 14/10/2015 16:00:14 -

Bummer. The Dagger test mfa has already been deleted.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

J.C



Registered
  22/03/2013 05:18:14
Points
  118
14th October, 2015 at 14/10/2015 20:37:28 -


Originally Posted by nivram
Bummer. The Dagger test mfa has already been deleted.

Marv



Oh, hi nivram!

Oh don't worry, It was actually moved out of my dropbox, I can re-upload it for you if you'd like.

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
15th October, 2015 at 15/10/2015 03:00:27 -

Here you go! https://www.dropbox.com/s/nqs40q6m0x3idjv/Throwable%20Dagger%20Test.mfa?dl=0

 
n/a

nivram



Registered
  20/07/2006
Points
  171
21st October, 2015 at 21/10/2015 02:32:52 -

Thanks a bunch JC.

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm
   

Post Reply



 



Advertisement

Worth A Click