Sound Effects

Non-platform specific questions.

Sound Effects

Postby Super Pieman » Tue Nov 06, 2007 1:39 am

I have a sound effect for when Mario jumps, but the sound effect can be triggered whenever the jump buttun is pressed, even in the air. How do I make it so the jump sound only plays when mario actually jumps?
Current Projects:
*Lonely (2%)
**LinkSys (1%)

*To be made in GE, then ported to DS.
**To be made for the DS.
User avatar
Super Pieman
 
Posts: 57
Joined: Sat Nov 03, 2007 3:27 pm
Location: Manotick (Ontario, Canada)
Score: 2 Give a positive score

Re: Sound Effects

Postby Game A Gogo » Tue Nov 06, 2007 1:45 am

create a variable named "in_air"
on collision with ground:
Code: Select all
in_air=0;

on collision finish of ground:
Code: Select all
createtimer("Jump", 100);//make it only repeat one time

on timer "Jump" :
Code: Select all
in_air=1;

on keydown of your jumping key:
Code: Select all
if(in_air==1)
{
    playsound2("/data/Mario_jump.wav" 0, 0, 1);
}

Not sure if the playsound is correct
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Sound Effects

Postby Super Pieman » Tue Nov 06, 2007 2:04 am

what do you mean by
on timer "Jump"
Current Projects:
*Lonely (2%)
**LinkSys (1%)

*To be made in GE, then ported to DS.
**To be made for the DS.
User avatar
Super Pieman
 
Posts: 57
Joined: Sat Nov 03, 2007 3:27 pm
Location: Manotick (Ontario, Canada)
Score: 2 Give a positive score

Re: Sound Effects

Postby Bee-Ant » Tue Nov 06, 2007 11:22 am

Go to TimerEvent>ScriptEditor
:D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Sound Effects

Postby Game A Gogo » Thu Nov 08, 2007 12:49 am

click Add=>Timer=>Jump=>Add=>Script
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron