Marble sound

Posted:
Thu Mar 18, 2010 8:47 am
by akr
I am thinking about how to make a marble game on iPhone. Whats the best way to play a "rolling" sound when the marble is rolling?
idea:
Ondraw: if (xvelocity > 0 && yvelocity > 0) playsound("marble_rolling"); hmmm. Will not work because playsound would be called every tick....
Andreas
Re: Marble sound

Posted:
Thu Mar 18, 2010 1:41 pm
by makslane
I think the best way is play the sound with a loop when the ball start the movment
and stop the sound when the balls stop.
Re: Marble sound

Posted:
Fri Mar 26, 2010 12:30 pm
by thunderios
Does it start rolling when you click a button? Then you can do something like:
On Button Down
- Code: Select all
Playsound("Marble_Rolling")
CreateTimer("Event Actor", "RollLength", Time The Marble_Rolling takes);
On Timer Finish
- Code: Select all
if (velocities > 0)
{
Playsound("Marble_Rolling")
CreateTimer("Event Actor", "RollLength", Time The Marble_Rolling takes);
}