how to compare words?

0 favourites
  • 8 posts
From the Asset Store
Simple but fun word game. Restore an original word from shuffled letters.
  • i am trying to make typing game using Construct 2 and i dont know how to compare words or letters in it.

    i cant set conditions for this term. can any one help me out? By the way i am not native speaker so please use simple texts

  • You can compare text like any other value in Construct. The only thing is, that comparing text is case sensitive (Hello and hello are not equal)

  • You can compare text like any other value in Construct. The only thing is, that comparing text is case sensitive (Hello and hello are not equal)

    You could ofcourse convert the whole text to lowercase or uppercase before comparing if needed:

    lowercase(text)

    Convert the given text to all lowercase

    uppercase(text)

    Convert the given text to all uppercase

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks for your reply! and since you are the only one i can write pm to because i am new to scirra and i dont have enough rep, can you please tell me this?

    how to pick the first letter of a word and substract it from the text when i press the right letter? Can you give me a detailed answer. if i get this, i have a great game idea.

  • If I understand what you are asking:

    Using these two

    system expressions

    right(text, count)

    Return the last count characters of text.

    len(text)

    Return the number of characters in text.

    So that would become

    set text to : right(text,len(text)-1)

  • thanks it really works. and it works too good that it wipes all letters one by one till it is all gone. i think i need to set right conditions for it. THANKS IT WAS A BIG HELP!!

  • hi LittlelittleStain!. i have another thing to ask. can u plz help me plz!

    first by your help now i can substract the first letter of a word and now i am trying to count mistakes when i hit the wrong key.

    i thought it would be done by inverting the previous condition and adding keyboard condition that triggers when any key pressed.

    Buuuuut it is not working! Aand i need your help once again.lol

  • You should post a new topic with a precise explanation of what you have done (either post your capx or at least a screenshot of your code), what you are expecting this current code to do and what you are actually experiencing.

    I don't understand what you mean by "Counting mistakes hitting the wrong key", it doesn't make sense to me with your previous question about subtracting letters from a word.

    You should rather explain the overall idea of the mechanic you are trying to implement.

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