Discuss Scratch

COLDEX0700
Scratcher
25 posts

Making a typing game...

I'm making a typing game, but I've found that even if u mis-type (for example if you're asked to type “Batter” but you spell “Bstter” it still goes to the next question, I'm quite new to the
ask [] and wait

command so i'm not sure what to do
DifferentDance8
Scratcher
1000+ posts

Making a typing game...

Pretty simple solution to a pretty simple problem

ask [...] and wait
if <(answer) = [...]> then

...

else
...
end
COLDEX0700
Scratcher
25 posts

Making a typing game...

DifferentDance8 wrote:

Pretty simple solution to a pretty simple problem

ask [...] and wait
if <(answer) = [...]> then

...

else
...
end
that's exactly what I did, (but leaving the the else blank). Yet it keeps executing the command in if: then even when the answer is wrong

https://scratch.mit.edu/projects/742357720/

Last edited by COLDEX0700 (Oct. 7, 2022 10:09:04)

DifferentDance8
Scratcher
1000+ posts

Making a typing game...

COLDEX0700 wrote:

that's exactly what I did, (but leaving the the else blank). Yet it keeps executing the command in if: then even when the answer is wrong
Then, either make a “wrong” broadcast or just don't have the else bit of the if block.
If you have nono word: Enable “block switching”, then right click the if else blocks and turn them into if blocks.
If you don't: You will have to manually drag the block out of the if tab, then remove the if else block and replace it with a if block. Finally, place the block back into the if tab.
MasterofTheBrick
Scratcher
1000+ posts

Making a typing game...

removed

Last edited by MasterofTheBrick (Oct. 7, 2022 13:26:21)

deck26
Scratcher
1000+ posts

Making a typing game...

How do you know it isn't working as expected? The second sprite is hidden so the say block won't do anything.

This would be a good project for a list so you can randomly choose an item from the list and ask the user to type that.

set [myrandom v] to (pick random (1) to (10))  // assumes 10 items in the list, adjust accordingly
ask (join [Type ] (item (myrand) of [list v] :: list)) and wait
if <(answer) = (item (myrand) of [list v] :: list)> then
else
end
That's much better than repeating the same code over and over.
hauntedscratcher3
Scratcher
2 posts

Making a typing game...

Hi im trying to make a typing game more like a console Operating system ant ideas or help?

hauntedscratcher3
Scratcher
2 posts

Making a typing game...

hauntedscratcher3 wrote:

Hi im trying to make a typing game more like a console Operating system ant ideas or help?

hi

Powered by DjangoBB