# Distributing geometric figures on a board

Get help using Construct 2

### » Mon Sep 30, 2013 7:37 pm

Hi guys,

I want to distribute randomly nine quads on a board but
they cannot be touch one another and will better if have a minimum distance between them. I thought in put them on a board that will divided into squares to allow the exact location of parts, for example: a square occupied one square (logically), a rectangle = 3 or 4 squares, trapezium = 02 squares, etc. In this case I have to use an array or just a grid? Could anyone give me some tips on how to do this, especially if you have to use array? thank youRenatoB2013-09-30 21:18:32
B
74
S
14
G
4
Posts: 1,050
Reputation: 8,205

### » Tue Oct 01, 2013 12:52 am

I did that once by picking a bunch of random locations on the map, and then picking the location nearest each start location.

In other words, each of the 9 start locations are predetermined, but they are only used to pick the nearest random location.

In my case it placed a bunch of castles at random, and then picked 4 that were nearest the corners for 4 players start locations.
("Pick Nearest/Furthest" is under "Size & Position" in the object's conditions)

You could also use the "Distance" expression to make sure they aren't too close together as well.
B
255
S
65
G
34
Posts: 907
Reputation: 41,611