Generate a random sound on a touch press
MasakoX
Member Posts: 16
Hey everyone,
It's my first post here so I may be a little naive. I'm making a small app where the core mechanics are that when you press on a character's face, one of 16 morale-boosting phrases plays. I want it to be random so the longevity of the app's usefulness is extended.
So what I'd be looking to do is set up a game attribute and then establish that only 16 sounds will play and then reset it back to 0 after the touch is pressed so that the cycle can begin again. How would I go about that?
Thanks
It's my first post here so I may be a little naive. I'm making a small app where the core mechanics are that when you press on a character's face, one of 16 morale-boosting phrases plays. I want it to be random so the longevity of the app's usefulness is extended.
So what I'd be looking to do is set up a game attribute and then establish that only 16 sounds will play and then reset it back to 0 after the touch is pressed so that the cycle can begin again. How would I go about that?
Thanks
Comments
first pick the random number by setting up an Attribute, I'll call it sound.
Change Attribute -- sound -- random (1,16) <-- This will pick a random number between 1 and 16.
Then set up 16 Rules like this:
If sound = 1 -- play sound 1
If sound = 2 -- play sound 2
etc., etc.
Kind of a pain, but that's the best way to handle it now I believe.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page