mardi 26 mai 2015

CORONA SDK : playing sound randomly

I'm in middle of creating a game and I wanted to play specific sounds when the player plays the game

-------------AUDIO STUFF-----
------------SOUND 1-------------
colsound = audio.loadSound("crowd.mp3")
function playSound( event)

    audio.play(colsound) 

end

    timer.performWithDelay(1000, playSound)
------------SOUND 2-------------
crowd = audio.loadSound("applause.wav")

function playSound1(event) 
    audio.play(crowd) 
end
timer.performWithDelay(2000, playSound1)

------------------------------------

I want to play sounds randomly (create a table then call the sounds to be played randomly without forgetting about the delay because it needs to be played during a specified time) .




Aucun commentaire:

Enregistrer un commentaire