Random letter, Picking the right one.

This forum is currently in read-only mode.
  • Hi all

    Ive browsed the forum and couldnt find anything that could help me.

    Im trying to do this.

    On a screen we see 3 randomly generated letters and only one of them is the right one, that you have to pick. How do you set that up. Do you use if loops?

    Im only after the generation and pick function. Ive done all the visual and showing letters part. But they only appear randomly. And i want to make sure that only one is the right one.

  • Create only two random letters, + the letter that is the right one.

    Are these letters you want to create from a text object, or sprites?

    Can you post an example cap of what you're trying to do?

  • My cap isnt that well build up, im kinda messing around to learn Scirra.

    But imagine this:

    A "right" letter is picked at the beginning which is secret "S"

    you have 3 positions                          1     2     3

    and i want to generate 3 random letters       X     S     E

    but only one, "S" is the right letter.

    So it also has to random place at one of the 3 positions.

    Am i making my self clear enough or am i messing it up?

  • Ok, how about this:

    After creating three different random letters, check if the correct letter is already there. If it isn't, pick one letter at random, make it spawn the right letter, and then destroy that letter.

    Do you want me to post an example cap?

  • It sounds like a good and logical way to do it.

    It would be great if you had an example cap. Im still trying to figure out how to do if loops and logics like that in scirra.

    Thanks.

  • One of various methods:

    distributingletters.cap

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Wow brilliant and in so few events. Im gonna go study it closer. Thanks that is exactly what i had in mind.

    Thanks. :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)