Randomizing flashcards?

farahmedfarahmed Member, PRO Posts: 33

Hi I have all my flashcard content in a table in GS. I would like to know how I can have my app display them in a random order. Right now it is displaying in order of one to 10. Any help would be much appreciated!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Let's assume you have a "next flashcard button" and that your flashcards are a single scene rather than multiple. In the "next flashcard button" actor:

    When Touch is Pressed
         Change attribute game.cardNum (integer) to random(1,tableRowCount(tableName))

    Then constrain the flashcard image to game.cardNum and make sure all of your flashcard image filenames are 1.png, 2.png, 3.png, etc. all the way up to the number of rows in your table.

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

  • ookami007ookami007 Member Posts: 581

    Actually, there is a great tutorial on random non-repeating table tutorial from gshelper.com:

    I would use the the copytable to copy your master flash card table to a temp table and then generate from the temp table since his method involves deleting rows.

    This method works well and I used something similar in one of my apps.

  • farahmedfarahmed Member, PRO Posts: 33

    great will look into these solutions! Thank you!

Sign In or Register to comment.