0 Favourites

how to compare words?

  • 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

  • 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.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
3 word story
120 11,701
MPPlantOfficial's avatar
MPPlantOfficial
Unread hot topic
29 2,465
wizdigitech's avatar
wizdigitech
Unread hot topic
0 Favourites
How do I delete words?
25 812
IGDev's avatar
IGDev