Discuss Scratch

PhysicsLover999
Scratcher
100+ posts

Help with a Scrabble Game

So, I need the tile (Which currently just says “A”) to go to the square closest to the mouse. I've tried, but I just can't get it! Please Help!
tygamer1234
Scratcher
44 posts

Help with a Scrabble Game

PhysicsLover999 wrote:

So, I need the tile (Which currently just says “A”) to go to the square closest to the mouse. I've tried, but I just can't get it! Please Help!
Here you go:
whenclickedset(Block)toorororgoto(Block)
Just an example! Not exact, just one bit! That's a bit you might want!

Last edited by tygamer1234 (Jan. 19, 2015 23:28:16)

PhysicsLover999
Scratcher
100+ posts

Help with a Scrabble Game

tygamer1234 wrote:

PhysicsLover999 wrote:

So, I need the tile (Which currently just says “A”) to go to the square closest to the mouse. I've tried, but I just can't get it! Please Help!
Here you go:
whenclickedset(Block)toorororgoto(Block)
Just an example! Not exact, just one bit! That's a bit you might want!

Actually, I'm pretty sure what I have right now only needs a couple changes.
PhysicsLover999
Scratcher
100+ posts

Help with a Scrabble Game

Bump
InternetUser_005
Scratcher
100+ posts

Help with a Scrabble Game

Hello,

I looked at your project and I am not sure I understand exactly what behavior you want to program. I am guessing you want one of the following:

1.) The tile follows the mouse but sort of sticks to the center of the squares as it does so, then when you click, the tile will stay placed.

2.) You click a square on the board and the tile centers itself on that location.

3.) The tile sticks right to the mouse cursor then when you click the board it is placed on the clicked square.

This looks like a cool project and shares some aspects of a project I am working on. Once I know for sure what you are after I will have a whack at it.

Edit #1: Can you explain what the “Distances” block in Board2 is all about. Can you just explain the logic and exactly what you want to happen. I follow it pretty well until the join blocks then I'm lost. Also, It appears you are trying to set a unique id for each clone, but that is not working. The variable CloneID will need “for this sprite only checked”.

Edit #2:
I did a remix and got unique clone id's working and implemented option #1 above:
http://scratch.mit.edu/projects/43973890/


IU5

Last edited by InternetUser_005 (Jan. 20, 2015 05:09:07)

PhysicsLover999
Scratcher
100+ posts

Help with a Scrabble Game

InternetUser_005 wrote:

Hello,

I looked at your project and I am not sure I understand exactly what behavior you want to program. I am guessing you want one of the following:

1.) The tile follows the mouse but sort of sticks to the center of the squares as it does so, then when you click, the tile will stay placed.

2.) You click a square on the board and the tile centers itself on that location.

3.) The tile sticks right to the mouse cursor then when you click the board it is placed on the clicked square.

This looks like a cool project and shares some aspects of a project I am working on. Once I know for sure what you are after I will have a whack at it.

Edit #1: Can you explain what the “Distances” block in Board2 is all about. Can you just explain the logic and exactly what you want to happen. I follow it pretty well until the join blocks then I'm lost. Also, It appears you are trying to set a unique id for each clone, but that is not working. The variable CloneID will need “for this sprite only checked”.

Edit #2:
I did a remix and got unique clone id's working and implemented option #1 above:
http://scratch.mit.edu/projects/43973890/


IU5


Yes, what I want is some sort of system so that the tile goes to the square closest to the mouse. The “Distances” list contains the distance from every board tile to the mouse pointer.
drmcw
Scratcher
1000+ posts

Help with a Scrabble Game

gotox:floorofmousex/24*24y:floorofmousey/24*24
should get you started.
PhysicsLover999
Scratcher
100+ posts

Help with a Scrabble Game

drmcw wrote:

gotox:floorofmousex/24*24y:floorofmousey/24*24
should get you started.

Omg TY!
gtoal
Scratcher
1000+ posts

Help with a Scrabble Game

PhysicsLover999 wrote:

So, I need the tile (Which currently just says “A”) to go to the square closest to the mouse. I've tried, but I just can't get it! Please Help!

I put some effort into handling tiles just like that - see in http://scratch.mit.edu/projects/21234602/

You're right, it's tricky! You have to use the center of the tile to decide where to drop it, not the mouse location. The difference becomes obvious when you pick up a tile by clicking near the edge of the tile rather than its center.

G
RythmKing4k
Scratcher
1 post

Help with a Scrabble Game

I need help with a lot of stuff like a board

Powered by DjangoBB