The Daily Click ::. Forums ::. Klik Coding Help ::. Creating spent rounds when firing a gun. (mmf2)
 

Post Reply  Post Oekaki 
 

Posted By Message

tetsuya_shino



Registered
  12/08/2004
Points
  491
18th January, 2014 at 18/01/2014 10:57:34 -

Greetings. Thanks to Chaos hooking me up, I finally made the move from TGF to MMF2. And it's differance is.. amazing.

Anyways, I am trying to make a platform shooter, and I have a question. How to I create spent shells that appear from the gun character's gun, arc backwards while spinning, then bounce when they hit the ground?

In the past I drew the above as part of the actual shooting animation. But I realized when the character is standing on a tiny platform, the spent shells would appear to bounce off empty space. What is the best way to go about doing this? Thanks.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
18th January, 2014 at 18/01/2014 12:38:19 -

You could easily make the shells an entirely unique object with their own physics. Doesn't have to be complex, just some basic X and Y movement and just make their Y movement the opposite of what it was when hitting the floor or ceiling.
If thats a bit vague i can go into more details.

The spinning around part should probably be either an animation or MMF2's built in rotation effect.

 
.

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
18th January, 2014 at 18/01/2014 14:37:08 -

If you want to see an example of this already made (though I have no idea if it follows AndyUK's method), have a look here. Search for "Bullet Shell Example."

http://www.castles-of-britain.com/mmfexamples-a.htm

 
n/a

tetsuya_shino



Registered
  12/08/2004
Points
  491
19th January, 2014 at 19/01/2014 00:19:17 -

Thanks for the link, s-m-r. That example would be perfect if it had the shells bounce after hitting the ground. Since it doesn't, I wonder if you can explain your idea in more detail, AndyUK. Thank you.

 
n/a

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
20th January, 2014 at 20/01/2014 00:37:40 -


Originally Posted by tetsuya_shino
Thanks for the link, s-m-r. That example would be perfect if it had the shells bounce after hitting the ground.


Maybe give the objects a pinball movement? Collision with a backdrop makes it bounce. When its movement is at 0, paste it into the background.

 
n/a

tetsuya_shino



Registered
  12/08/2004
Points
  491
20th January, 2014 at 20/01/2014 03:42:04 -

Hmm.. tried that could couldn't get it to bounce when hitting the ground. But it's okay I guess. I did get them to fly out from the gun and spin. And while I am sure it's a mistake in the code, you can make the bullets float like butterflies until you release the fire key. Which is odd, but cool in a way. Thanks to both of you.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click