How do I get words from a dictionary?

1 favourites
  • 4 posts
From the Asset Store
Simple but fun word game. Restore an original word from shuffled letters.
  • Hi,

    I am doing an assignment for school and the task was to make an educational game. Me and my friend came up with an idea like this: A player is given an incorrect word, and must catch the correct letters (which fall down the screen) to spell the word correctly. If they spell the word correctly by catching all the correct letters then it adds 100 points to their score and gives them another word. If they spelt it incorrectly then it will take away a life, and change the word. Hopefully that kinda makes a bit of sense.

    [attachment=1:vm7ehl1m][/attachment:vm7ehl1m]

    I would like to apologise for my bad drawing but it was a quick sketch.

    Can I please be pointed in the right direction on how to start this? I was thinking something like outputting a random letter, then on collision of the bucket it deletes the letter and adds it to a hangman-like thing at the top. When the amount of letters at the top has been filled then it checks the word to a dictionary. If it is incorrect it takes away one life and skips to the next word. If the player gets it right then they get 100 points added to the score, and then skips to the next word. Sorry for being an absolute noob

    (I did do the first tutorial with no issue)

    but I am not sure how I would go about doing this or if it is even possible.

    I made a flowchart for what I would like to happen.

    [attachment=0:vm7ehl1m][/attachment:vm7ehl1m]

    Again I apologise for my limited knowledge on Construct 2 (I started with GameMaker but it is too buggy) and the title, couldn't think of anything else. Thank you so much for helping me! If you have any questions or can't read my writing (fair enough) please ask.

    Maybe I could use Arrays or load from a JSON file.

    Thanks,

    Brad

    EDIT: Apparently can't post with URLs in the body.

  • Sounds like a good idea. Here's I how would approach it:

    Add the words to a project file, either in JSON format or just on separate lines.

    At the start of the game, load the words from the file into an array.

    At the start of the level, choose a random word from the array (goalWord).

    Shuffle the letters in goalWord to create the misspelling and display that.

    Start spawning letters - the letters from the goalWord plus some random ones.

    The letters are a sprite with an animation for each letter - the animation name is the letter "a", "b", "c"...

    When the letter hits the bucket then add it's animation name to a string (guessWord).

    Compare guessWord with goalWord. If guessWord has length n, compare it to the first n characters in goalWord. If they don't match -> LOSE.

    Keep going until the length of guessWord = length of goalWord. If they match -> WIN, else -> LOSE.

  • Here's a start. Before anyone calls me out for writing this students program for him, many C2 users struggle with arrays, so this mainly sets the pattern for indexing into arrays and indexing into strings. There's still plenty to do.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's a start. Before anyone calls me out for writing this students program for him, many C2 users struggle with arrays, so this mainly sets the pattern for indexing into arrays and indexing into strings. There's still plenty to do.

    Oh wow! Thank you so much, you have helped me greatly. I really can't thank you enough. If only I could give back to you somehow... Please let me know if you want anything in return

    Also thank you to Ramones for helping me out a lot. I will post the final game in the correct part of the forum.

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