Placing mutiple items dynamically, with varying setsize


Author
Message
Brabagazaa
Brabagazaa
Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)Esteemed Member (1.5K reputation)
Group: Forum Members
Posts: 13, Visits: 79
Hi all,
I am trying to build an experiment that places 9 items on the screen, one of which is a target and 8 of which are
'filler' items. The target can appear randomly at each location; and the filler items are placed around it in a circle, an example image in the attachment.
A complication is that sometimes the setsize will be 9 and at other times 7 or 5; this means that the position of the fillers changes
depending on the set size.

I have currently build a long 'if statement' for each filler item that check the position of the target and places the fillers around it, like so:

/ filler_position1 = if (values.hpos1==27) values.absolute_h_2_set5; if (values.hpos1==24) values.absolute_h_3_set5; etc
/ filler_position2 = if (values.hpos1==27) values.absolute_h_3_set5; if (values.hpos1==24) values.absolute_h_4_set5; etc
/ filler_position3 =
etc, etc
(hpos1 is the horizontal position of the target item which is chosen at random)

My question is if there is a more concise way to achieve the placement of these fillers, any suggestions welcome,

Roelof


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Brabagazaa - 7 Years Ago
Dave - 7 Years Ago
Brabagazaa - 7 Years Ago
Dave - 7 Years Ago
                     + x [quote] [b] Dave - Thursday, October 26, 2017 [/b]...
Brabagazaa - 7 Years Ago
                         + x [quote] [b] Brabagazaa - Thursday, October 26, 2017...
Dave - 7 Years Ago
                             + x [quote] [b] Dave - Thursday, October 26, 2017 [/b]...
Brabagazaa - 7 Years Ago

Reading This Topic

Explore
Messages
Mentions
Search