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

#1 2012-07-18 05:13:53

Anisia
New Scratcher
Registered: 2012-03-01
Posts: 2

Wordsearch help needed urgently please

I have built a wordsearch but I don't know the script to let the user highlight each letter which will then elastic band the word. I don't want to get into complicated scripting where the word must match the listed word I just want a simple solution - at the moment the only way I can think of doing it is by using the co-ordinate positioning?

It is also important to not allow an elastic band of the group of letters if it is wrong - again I am thinking could this be based on co-ordinates?

Any suggestions very welcome!!!!  It's diving me mad

Offline

 

#2 2012-07-18 17:19:46

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Wordsearch help needed urgently please

Hey  smile  To select a letter and highlight it, you should make a square the same NxN area as the square the letters are in. Then, set the square's x and y to:

Set x to ((Round (([X Position v] of [Ball v]) / (N))) * (N))
Set y to ((Round (([Y Position v] of [Ball v]) / (N))) * (N))
 
This will only allow the highlighter to highlight a letter. Then, when mouse clicked, have it stop the script above and stay in position. Have another highlighter then go to the mouse and do the same until mouse down. So now there are 2 Highlighted squares on the grid. Assuming you have no diagonal words (makes it easier), you can keep the second highligher in line with the first by making a condition, the x or y position of the second highligher must = the x or y of the first, thus locking it in the x or y axis of the original highlighed square. You could then use the pen or something to do the 'elastic band effect'.  smile

Good luck!  big_smile

Last edited by Prestige (2012-07-19 10:49:01)


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#3 2012-07-18 18:49:00

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Wordsearch help needed urgently please

^^ Yeah, for the "elastic band," you could use the pen to draw a line with a large thickness in black, and then another line over that in a smaller thickness and white color.

Offline

 

Board footer