Play sound randomly

Hi all,

I'm trying to play 10 sound files randomly using the method below:

- Created a random number generator 1-10.
- Create 10 play sound rules (when attribute number = 1, play sound 1; number = 2, play sound 2, and so on)

Everything is working fine. I'm just wondering if there are any other better ways to do it since I'm thinking of playing 100 sound files randomly and creating rule for each of them would be too much MB for the app because I believe that the more rules we created, the more MB the app will be.

Any suggestions would be appreciated.

Thanks,

Alan,

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    First of all, rules themselves do not take up much space at all. Sound files and images do. Your method is currently the best available as there is no way yet to specify sound files by expression.

    I just built a custom app for a client that does incorporates a random sound playback system and one thing I noticed is that when I had all of those rules in a single actor, editing that actor lagged pretty badly. It could take a minute or so to open the actor, a long time to scroll down the rules, etc. It always made me worried the app would crash (and occasionally it did). I thought about placing some rules in a second or even third "sound control" actor but in the end I left them in a single actor. Just something to think about as you go forward.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.