Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ambient sounds
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#3
RE: Ambient sounds

I have random ambient sounds in one of my earlier maps, it isn't HARD to do, but it is a fair bit of code the way I did it. There may be a simpler way, but here's how I did it:

In OnEnter and any checkpoints, I call a timer that calls a function that picks a random number 1-8 (the number of sounds I have it choosing from). Then, I have an if statement for each sound I want it to play corresponding to a particular number. So, if the random number happens to be 4, it will play the sound I designated to 4.

Does that makes sense?

04-19-2011, 02:53 AM
Find


Messages In This Thread
Ambient sounds - by Danny Boy - 04-19-2011, 12:30 AM
RE: Ambient sounds - by Danny Boy - 04-19-2011, 02:33 AM
RE: Ambient sounds - by Anxt - 04-19-2011, 02:53 AM
RE: Ambient sounds - by Apjjm - 04-19-2011, 04:36 AM



Users browsing this thread: 1 Guest(s)