How do I use dictionaries to categorize words?

0 favourites
  • 3 posts
From the Asset Store
Simple but fun word game. Restore an original word from shuffled letters.
  • Here is my English grammar game:

    https://drive.google.com/file/d/0BwoMdS ... sp=sharing

    The idea is you type a sentence and then it breaks the words up into moveable sprites. I was wondering how to use a dictionary to change the background color of the sprites according to parts of speech. As it is right now they are all grey.

    Let's say pronouns are the color blue, verbs green, and adjectives are red. So if I type in "he is tall" then when the sprites are made "he" has a blue background, "is" has a green one, and "tall" has a red one.

    Any ideas for this? I know I can use the animation frames to change colors but I don't know how to set up a dictionary with the parts of speech and then have it read through them and change the frame accordingly.

    Thanks,

    Greg

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Give them "instances" or "object names", where the key will have the desired behavior, like pronouns and so on..

    For each type, one dictionary.

    I would add with dictionary an array, maybe it turn things easy, but...

    Check what key is being called with the word and change its color to the correspondent instance.

    Something like this:

    Condition: On word created;

    Sub-Condition 1: Is instance (or object name) = "Pronouns";

    Sub-Action 1: Change text color to red;

    Sub-Condition 2: Is instance (or object name) = "Verb";

    Sub-Action 2: Change text color to green;

    etc...

    Using an array within, you could check inside the array what word it was and setup accordingly its X,Y2.

  • Thank you sir I got it.

    Tim Maia

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