This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-03-23 17:21:51

Crosshairs
New Scratcher
Registered: 2011-01-19
Posts: 5

hangman game

Hello
I am making a hangman game for a controlled assessment and would like to know if there is any way of replacing the letters in a variable with asterisks or dashes and when the correct letter is chosen the asterisk(s) are replaced with the letter. Thank you  smile

Offline

 

#2 2011-03-23 19:25:19

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: hangman game

Is this what you're looking for?

http://i54.tinypic.com/15hlpi9.gif

Obviously, you'll need to add lives and possible modify it to suit you needs, but I think that does in general what you're looking for. Hope that helps!  smile


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#3 2011-03-24 12:52:01

Crosshairs
New Scratcher
Registered: 2011-01-19
Posts: 5

Re: hangman game

Thank you very much, i think i get the general idea of how it works, is there a version that works with keyboard (QWERTY) sprites?

Offline

 

#4 2011-03-24 19:32:27

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: hangman game

Crosshairs wrote:

Thank you very much, i think i get the general idea of how it works, is there a version that works with keyboard (QWERTY) sprites?

Like, one that tells letter sprites to show/hide? A single added block will do that:

http://i52.tinypic.com/2n8voch.gif

And for each letter, there should be a script that looks like this:

http://i56.tinypic.com/104117l.gif

That, for example, would tell the A sprite to show.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#5 2011-03-25 14:23:28

Crosshairs
New Scratcher
Registered: 2011-01-19
Posts: 5

Re: hangman game

Could i also ask what the 'i' variable is?

Offline

 

#6 2011-03-25 19:24:41

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: hangman game

"i" is just a variable used to count the number of times the loop has repeated.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#7 2011-03-25 19:26:18

puppetadventurer
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: hangman game

Crosshairs wrote:

Could i also ask what the 'i' variable is?

of course


3

Offline

 

#8 2011-03-27 10:17:29

Crosshairs
New Scratcher
Registered: 2011-01-19
Posts: 5

Re: hangman game

Okay, i tried your block and it worked, but one problem:

<set{ display }to( display

this makes the visible letters show up in an array format. Could you give any help or perhaps an alternative?

Offline

 

#9 2011-03-27 16:34:56

Crosshairs
New Scratcher
Registered: 2011-01-19
Posts: 5

Re: hangman game

Dont worry, problem sorted. Thanks for the tips Harakou  smile  I now have a fully working product

Offline

 

Board footer