#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Need to Randomize Music Sounds

Posts: 8Member, PRO

Yo i´m Working on a Booty Smack Game
Is About B.I.G want´s You Too Join BadBoy Records
But Before Lettin You In He Needs To be Sure You Can Do Music
So You Got These Booty´s From Girls To Smack And Make Music Out Of Em
So The idea is .. you smack the booty´s Right but you need to do it in the right order
How do i randomize the sounds so you need to do em after it been previewed ?

• Posts: 2,239Member

Man you write a lot of nonsense before asking your question.
What you want is a "Simon Says" logic.

"
A random sequence is played first.
While the player has to memorise the order.
Than the player does his input and its checked if its right.
"

• Posts: 2,239Member
edited July 2017

So first determine the amount of Sound options.
Example: Lets say 5.

Than determine the amount of memorised sounds within a sequence.
Example: Lets say 6

Create a text attribute, lets call it sequence
Create a Loop until sequence has text length 6
do
->change attribute = "sequence"..(rnd(1,5))

You end up with a text string like this
35251

respecting the definitions set above.

Than you play the order for the player one by one.
You can use textSubStr(sequence,1,1) which would gives you the result of the first digit within your sequence, in our example = 3
textSubStr(sequence,2,2) =5
textSubStr(sequence,3,3) =2
etc.

You blink up the button/position + play the sound related to that sound option.

After this its the players turn for his input.
Make another int attribute = playerinput
and another int att. = sequenceprogression

Set the sequenceprogression
if the player presses any of your 5 input options
increase the sequenceprogression+1 (change attribute)
and set the playerinput to the according input option value (change attribute)

than check if
player input = textSubStr(sequence,sequenceprogression,sequenceprogression)

if yes it continues, you might give some form of feedback or just play the related sound

if no the player failed you might wanna reset your sequence and all the steps above, don't forget to reset all int variables to 0 too.