I need help! And it seems pretty advanced! How can i get a simple script to check a 3X3 area for 5 different colors? Right now, I have a REALLY long script which moves and than checks. Is there an easier way (I use the stamp function and a sensor)?
O.K., I'll go put it in AAS too
And than it keeps checking until it can't find any of the same colors (if you can)
Last edited by Bluestribute (2008-06-27 04:04:54)

Offline
This must be more work on the Virtual Rubics Cube? Can you describe the problem in more detail? You want to know if a particular color is in the grid?
Offline
I agree with Paddle2See re getting more info, but if you're checking for colors in a 3x3 area, i would just have nine simple sensors, all staying a certain position relative to the central sensor, where each sensor simply keeps checking to see what color it's touching (and assigning that to a number 1-5). Sometimes its easier to do stuff in parallel with many sprites, since that is something scratch is really good at.
Offline
O.k.:
I have the entire screen filled wit different colors (using the stamp function). When you click one, a sensor comes. It will check to see how many of the same colored objects are around it.

Offline
i did something similar in my minesweeper game.
I used a sprite with eight dots in a square so one goes on each of the sqaures around it.
Each dot is a different colour.
I have a variable called neighbours.
I then have a checking process like this:
if colour1 over (whatever colour), change neighbours by 1
etc x 8
After this you use the variable neighbours to say how many neighbours have the same colour.
Its quite a long script i know but it works.
Offline
bigB wrote:
i did something similar in my minesweeper game.
I used a sprite with eight dots in a square so one goes on each of the sqaures around it.
Each dot is a different colour.
I have a variable called neighbours.
I then have a checking process like this:
if colour1 over (whatever colour), change neighbours by 1
etc x 8
After this you use the variable neighbours to say how many neighbours have the same colour.
Its quite a long script i know but it works.
Hmmm.... I kinda get it! I'll try and see if I can use it by just reading this, otherwise I'll see your scripts.
I just realized I have soemhing like that. It changes it's X until the variable check doesn't equal the color, than it goes down. It's just so hard though!
Last edited by Bluestribute (2008-06-27 15:31:26)

Offline
I don't get it

Offline