Same pick operation an arbitrary number of times

For questions about using Classic.

Post » Fri May 27, 2011 5:20 pm

Still a little hazy, but I would start with a container and an object that does lists on the sprite that your dragging, unless your dragging one of the instances.
That way the object being dragged can add all the sprites to its list, then to avoid recursion you can do a loop comparing the overlapped sprites to something say the uid. Something like sprite overlaps sprite system compare sprite uid does not equal list(loopindex)... add uid to list.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri May 27, 2011 8:01 pm

The problem is that of course the list would change so it can't be in a container.

Firstly, it's NOT one of the sprites on which I check for overlaps that are being dragged. The sprites on which I check overlaps stay still. Other objects that are on top of those sprites are being dragged.

Here, let me try ot make it more intuitive

Imagine a 10x10 grid of square sprites that overlap their neighbors by 1 pixel. I have an object on top of one of those sprites somewhere in the center of the 10x10 grid, and I want to be able to move the object a radius of N. When the player drags the object, the radius of N sprites is highlighted to let the player know where they can drop the object. Ideally a distance expression would work for this above example, but instead of a 10x10 grid, teh sprites are in this case not necessarily equidistant as a function of their range (N) from the object (e.g. instead of physical distance and range, if you think of a network of sprites with varying sizes and locations of overlap, what i want to get is the distance of radius N in connection space)

When I drop an object, the sprite associated with it would change to the sprite on whcih I dropped it, so if I made a container that wouldn't work. Furthermore, it is possible to drop multiple objects on the same sprites, so although each object is associated with a specific sprite, the converse is not true, such that each sprite is not associated with just one object, it could be associated with multiple objects.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Fri May 27, 2011 8:26 pm

You mean like this? [url:2zkb2cdf]http://dl.dropbox.com/u/5426011/examples5/hexgrid.cap[/url:2zkb2cdf] made in cc1.2
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Fri May 27, 2011 8:43 pm

Yes, that's exactly what I mean. Why does Grid Filter is Red, Grid overlaps Grid work, whereas my same implementation except using:

[code:139omtv6]Repeat Range
Sprite PV IsPicked=1
Sprite overlaps Sprite ---> Sprite IsPicked set to 1
---> Sprite Set filter to red[/code:139omtv6]

...not work? It seems identical.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Fri May 27, 2011 8:47 pm

Oh I see, your Repeat is not nested under the picking for the first sprite. Huh, I guess I must not understand how picking works, removing the Repeat from the nesting makes everything work but I don't get why.

Thanks though :)
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest