Random Generator ?

JamieOneilJamieOneil Member Posts: 877
edited November -1 in Working with GS (Mac)
Okay i want to make an app where you touch a button and it comes up with a random sentence, but i want to choose the sentences that will be generated ? thanks :)

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You can make text attributes for all the sentences you want. So call the first one sentence1 and so on and have it be a text attribute and type the sentence in the value spot. Do that for all of them. Then make a interger attribute called sentencepick and set it to 0.

    Now in the actor you want to display the sentence make a rule for each text attribute you made(so if you have 5 sentences made drag 5 rules in the actor you want to display the sentences). Have the first rule when attrubyte sentencepick=1 display text and choose the attribute sentence1 for what your dispalying. Then go down to the next rule and have when sentence pick = 2 display text and display attribute sentence 2. Then do the same thing for sentences 3, 4 and 5(or however many sentences you have)

    Then in the button that your pressing have a rule when touch is pressed change attribute sentence pick to random(1,5)

    Hope i helped
Sign In or Register to comment.