Page 1 of 2
Pentominoes
Posted: Sat Jan 31, 2015 9:23 pm
by richmond62
These are great fun:
http://en.wikipedia.org/wiki/Pentomino
and it is dead easy to set up a base for this sort of thing . . .
one of the problems seems to be working out if shapes are overlapping each other.
Re: Pentominoes
Posted: Sat Jan 31, 2015 9:57 pm
by richmond62
Rotating non-square images still STINKS:
set the angle:

- angle.png (5.83 KiB) Viewed 14202 times
rotate:

- rotate.png (9.57 KiB) Viewed 14202 times
Re: Pentominoes
Posted: Sun Feb 01, 2015 11:56 am
by richmond62
So: I've implemented the daft shapes, the rotation buttons, and made them into groups with a script in each button to rotate each shape
and a script in each shape to drag each group.
Now the fun really starts with all those little white TARGETS and how to do the INTERSECT code.
Re: Pentominoes
Posted: Sun Feb 01, 2015 7:57 pm
by richmond62
Obviously THIS is not "on":

- bosh.png (7.9 KiB) Viewed 14127 times
The dark green-grey around the grid of targets is an image "MASQ" where the bit
that overlaps the grid if targets (well, lies behind it) is completely transparent.
Now the green block contains the following code, which should send it 'home' if it overlaps
any of "MASQ", but as you can see from the picture above does not:

- intersectCode1.png (11.27 KiB) Viewed 14127 times
I wonder why?
If one leaves out "pixels" the shape returns home even when it is inwith the transparent area.
Re: Pentominoes
Posted: Mon Feb 02, 2015 7:28 am
by paul_gr
richmond62 wrote:Rotating non-square images still STINKS:
It's been stinking for the last 5 years or so...
I lost a lot of hair working on rotation of various objects...
Paul
Re: Pentominoes
Posted: Mon Feb 02, 2015 7:29 pm
by richmond62
Well, I have found the best way to deal with this problem is to overlay one's image on a square graphic which
is transparent and has 0 width borders: group the 2: give them a daft name such as "DAFT" and then do this
in the Message box:
import snapshot from group "DAFT"
and, Hey-Nonny-Nonny-Nonny-No (and other equally meaningless magic-sounding phrases)
one ends up with a square image containing one's original image, at which point you
can rotate it to your heart's content without any distortion.
Re: Pentominoes
Posted: Mon Feb 02, 2015 8:53 pm
by bn
Hi Richmond,
you might want to have a look at this post from Jim James Hurley to the use-list.
http://runtime-revolution.278305.n4.nab ... l#a4276694
Kind regards
Bernd
Re: Pentominoes
Posted: Mon Feb 02, 2015 9:01 pm
by bn
Or you might want to see Jim James Hurley's idea in a stack
I don't know if this helps.
Kind regards
Bernd
Re: Pentominoes
Posted: Mon Feb 02, 2015 9:08 pm
by bn
Hi Richmond,
from the dictionary
The current setting of the resizeQuality property is used to determine whether to apply filtering to the rotation operation. If set to normal no filtering is used; if set to good or best a bilinear filter is used which significantly reduces the distortion that will naturally occur when an image is rotated.
The rotation operation does not have an inverse. Since some amount of distortion is unavoidable when rotating an image by an amount that is not a multiple of 90 degrees, rotating an image clockwise, then counterclockwise by the same amount does not completely restore the original image.
And
To rotate an image in a reversible way, or to do repeated rotations without progressive distortion of the image, set its angle property instead of using the rotate command. Unlike the rotate command, the angle property affects only the screen display of the image, not the actual picture data in it, so setting it repeatedly does not introduce distortion.
I would use angle, see stack above
Kind regards
Bernd
Re: Pentominoes
Posted: Tue Feb 03, 2015 11:25 am
by richmond62
Thanks, Bernd,
I'm not really having a vast problem with rotation because, as I wrote earlier, I make sure
that all non-square images are "embedded" in a square, transparent space.
However, I do think that, in the great scheme of things, it would ne super if one
could roatet non-square images, as they are - Ding-an-Sich, without distortion.
Re: Pentominoes
Posted: Tue Feb 03, 2015 11:26 am
by richmond62
What I am much more troubled about is the fact that "threshhold" with
INTERSECT does not appear to work properly.
Re: Pentominoes
Posted: Tue Feb 03, 2015 11:40 am
by bn
Hi Richmond,
did you try the stack I posted?
Kind regards
Bernd
Re: Pentominoes
Posted: Tue Feb 03, 2015 12:16 pm
by richmond62
Yes, I did, and I cannot see how that helps with THRESHOLD in any way whatsoever as that stack only uses one image.
However, I seem to have solved the THRESHOLD problem:
Obviously my image I am using for my Pentominoes game has got something wrong with it.
Re: Pentominoes
Posted: Tue Feb 03, 2015 12:37 pm
by bn
Hi Richmond,
Yes, I did, and I cannot see how that helps with THRESHOLD in any way whatsoever as that stack only uses one image.
It was more related to your rotate problem.
Kind regards
Bernd
Re: Pentominoes
Posted: Tue Feb 03, 2015 3:51 pm
by richmond62
Aha. Thanks, Bernd, I did not jalouse it was for the rotation "problem".