How do I get words from a dictionary?

Get help using Construct 2

Post » Mon Oct 20, 2014 9:48 am

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.

1960_003.png


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.

dictonarycheck.png


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.
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 2
Reputation: 179

Post » Mon Oct 20, 2014 2:07 pm

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.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Mon Oct 20, 2014 2:28 pm

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.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Tue Oct 21, 2014 10:44 am

blackhornet wrote: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 :D

Also thank you to Ramones for helping me out a lot. I will post the final game in the correct part of the forum.
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: MoscowModder, Yahoo [Bot] and 6 guests