help with basic word game for kids with special needs

jjnim1600jjnim1600 Member, PRO Posts: 3

Hello all,

I'm new to GS and was wondering if someone can help with this. Essentially, the aim of the game is to pick the right word in a sentence. For example, here's a sentence: "The kids are walking to school."

In this sentence, the goal is to pick "are." If "are" is picked, then a voice will say "good job!" and if other words in the sentence are picked, then the voice will say "try again."

If possible, I would like to use tables.

Thanks in advance for the help.

Wil

Comments

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

    Enter the words of the sentence with each word in a separate column of a single row of a table. Enter the correct word (e.g. "are") in the last column of the table. Add an actor to the scene and copy it on the scene so that you have one actor for each word. In the prototype actor, create a new text attribute called self.Word. Also create a new integer attribute called self.colCount. Also create a new integer attribute called self.wordNum. Open each instance (copy) of the actor in the scene, and change the value of that attribute to a number that matches the word position (e.g. first actor = 1, second actor = 2, etc.).

    Add these to the prototype actor:

    Change attribute self.Word to tableCellValue(tableName, 1, self.wordNum)
    Change attribute self.colCount to tableColCount(tableName)
    When touch is pressed
         When self.Word is tableCellValue(tableName, 1, self.colCount)
              Play sound [good job!]
         Otherwise
              Play sound [try again]

    You'll want to replace the 1 for the row number in each tableCellValue function with an attribute such as game.round or game.level. Then change that value as needed to advance to the next word.

    There's more to this, of course... you'll need to figure out how to know how many words are in the table for each sentence and how to hide actors that aren't needed for a particular sentence.

    This may not make a lot of sense right now since you are new to GameSalad but if you follow various tutorials online (e.g. Google GameSalad tables) and come back to this, you should be able to start setting it up and then asking questions about specific things you need help with.

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

  • PhilipCCPhilipCC Encounter Bay, South AustraliaMember Posts: 1,390

    @tatiang I know you were answering @jjnim1600 's question but you gave me an idea how to add some new functionality to one of my existing toddlers word games by applying this in another way. You explain so clearly how to set it up that it should be easy for me to implement. Thanks. :grin:

  • ValanValan Member, BASIC Posts: 410
    edited October 2016

    The good thing about GameSalad is that there is usually more than one way to make a salad.
    Tatiang has given an excellent recipe. Here's a cruder, but just as tasty version.

    Set up an actor. Name the actor "normal.Word". Click on the Actor.

    In Attributes panel set the Position Y to be your preferred position for the sentence.
    Set up a Display Text Behaviour; self.name
    Change Attribute self.color.Alpha to 0
    Set up a Rule; When Pressed Play Sound [Try Again]

    Go back to the Scene

    Press the alt/option key, click and drag the actor so than a + sign appears and copies the Actor. Rename this Actor "correct.Word"

    Go into the Actor and change the Play Sound [Good Job!]

    Go back to the Scene

    Put the actors on the Stage in their correct positions. double click an actor on the Stage(Instance).
    In Attributes panel change the Actor's Name to what you want displayed.
    In Attributes panel click on the Position Y and click the button 'Revert to Prototype'.

    Do the same for all the instances.

    Note
    Using a Change Attribute allows boxes to be seen when coding but when played the Attribute is changed to make the actor transparent, so only the display text is seen.

    Reverting to Prototype allows that attribute to be controlled by the Prototype. In this case the text can be moved up and down the Stage by changing just the prototypes Position Y Attribute.
    A Game level Attribute(Real) can created to be used to do this(and makes life easier). in the code use the Change Attribute Self.Position.Y to game.attributes name. Then the Y position is controlled automatically from that one attribute.

    Just thought - You may only need 3 instances on the stage since the instance actor's name can have several words e.g "The kids" or " walking to school.". This will help with text positioning.

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

    @PhilipCC You're welcome!

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

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @Valan said:
    The good thing about GameSalad is that there is usually more than one way to make a salad.

    Very true. :)

    Here is a link to my salad:

    http://forums.gamesalad.com/discussion/comment/589229/#Comment_589229

  • jjnim1600jjnim1600 Member, PRO Posts: 3

    I'm planning to have at least a few dozen scenes so perhaps figuring out how to use tables is the best strategy. Thank you, all, for the suggestions!

    After I attempt this myself, this is a thought, but if anyone is interested, you can email (jjnim1600 @gmail) about a possible 1-hour talk or consultation session (paid of course) around how to do this using tables.

    Thanks again!!

  • HopscotchHopscotch Member, PRO Posts: 2,782
  • jjnim1600jjnim1600 Member, PRO Posts: 3

    This is perfect, Hopscotch! Exactly what I was looking for. If I want to create 3 sentences within 1 row, is there a way to wrap the sentences on the stage so that they don't go off screen?

    Thanks so much!

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @jjnim1600 sure, you could expand the table and add as many words (sentences) as you like. Then add a small rule to the code to handle automatic line-feeds.

    However, if you really are aiming for a lot of words, which in turn become individual actor, then I would optimize the code a bit, making the positioning of the words be dynamic during setup, but predefined when the actual game runs.

    You could take it all a lot further, it all depends on the scope of your project, how many sentences you have, how many levels, etc.

  • ValanValan Member, BASIC Posts: 410

    Really nice Hopscotch!

    My concern with tables was the spacing of the words.

    This totally negates the need to fiddle too much.

    Nice Job!

Sign In or Register to comment.