The Daily Click ::. Forums ::. Klik Coding Help ::. Making sample play after player jumps and LANDS on a backdrop
 

Post Reply  Post Oekaki 
 

Posted By Message

Marcello64



Registered
  16/05/2007
Points
  144
27th March, 2008 at 09:06:15 -

I want to make a subtle non annoying sample play when the player hits the ground after coming down from a jump.
(Player has a jumping and falling animation, single frame animation for both)

I've tried the following:

'Falling' Animation is playing
'Player' collides with backdrop
PLAY 'HIT' SAMPLE

nothing happens,

I've tried just leaving the 'Player' collides with backdrop and it works perfectly, BUT of course as the player just walks on the ground the sample will play randomly.

I only want it to play the sample as soon as the player hits the ground from a jump. Just like in the Mega Man games.

Any Suggestions?



Image Edited by the Author.

 
Sig: I'm not the Marcello from Cellosoft.

Steve Hallam



Registered
  02/03/2008
Points
  37
27th March, 2008 at 09:11:10 -

Is the falling anim looped, or does it just play a single frame? It might help to change it into a looped anim.

Once you've figured that out, you might want to make a detector for the 'Player' feet - at this current stage, the sound will play when you collide when falling into 'any' backdrop - so if you were falling against a wall the sound would continually play. Putting a detector in the feet would make sure only when the feet touch a backdrop the sound will play.

 
Eyyyy Macarena!

Marcello64



Registered
  16/05/2007
Points
  144
27th March, 2008 at 09:34:05 -

Thank You, I can't believe it was that simple.

I got it working another complicated way but I'll set it to looped animation.

This is how i got it to work:

I added a 'Jump' Counter
When either animation 'JUMP' or 'FALLING' is over I set the counter to 1
When the player lands on the backdrop it sets the counter to 0

if JUMP counter = 0 then no sound will play when player is walking on ground
if JUMP counter = 1 and player hits ground then the sample plays

if anyone wants to check it out, I have a game I'm working on called 'Project Nintendo'

www.moco.net/ProjectNES_TECHDEMO.zip

any feedback is appreciated, I just want to know if its FUN at this point.

 
Sig: I'm not the Marcello from Cellosoft.

SoldjahBoy



Registered
  25/10/2006
Points
  100
27th March, 2008 at 17:41:22 -

Sounds interesting... will check it out later (when I'm not at work)

 
What's wrong with pillow shading? O.o

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
27th March, 2008 at 19:36:56 -

you could try using something like,

Only once when event loops + falling not playing = play sound hit

 
.

Marcello64



Registered
  16/05/2007
Points
  144
28th March, 2008 at 19:28:48 -

Strangely I KNOW i updated the demo to reflect the mega man jumping sample + some other random things, but it wasn't updating on my ftp. The link is fixed now but its nothing major.

www.moco.net/ProjectNES-TECHDEMO.zip

 
Sig: I'm not the Marcello from Cellosoft.

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
29th March, 2008 at 07:36:42 -

I'd do it - When player is jumping (however it's calculated) set some value to something. Player is on the ground + value is something; set value to 0 and play sound.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

viva/volt

Awesome Sauce

Registered
  26/08/2006
Points
  1694

Game of the Week WinnerSilverNova MemberKlikCast StarVIP Member
29th March, 2008 at 07:43:42 -

If I'm using PMO I use "Object is on ground" + Only one action when event loops -> play sound but otherwise a bottom detector is my approach.

 
Image
http://bfollington.tumblr.com

Vertigo

Made of awesome

Registered
  20/01/2008
Points
  1095

StrawberryVIP MemberWii OwnerI am an April Fool360 Owner
11th April, 2008 at 07:55:53 -

can be done way easier. Make a group with an event that has: If character collides with background then: deactivate this groupa and play a sample. Activate the group when you push the jump button.

 
www.muffachine.com - www.woutervanvugt.nl

Image
   

Post Reply



 



Advertisement

Worth A Click