Distributing geometric figures on a board

Get help using Construct 2

Post » 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
13
G
4
Posts: 1,000
Reputation: 8,041

Post » 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
230
S
62
G
33
Posts: 902
Reputation: 40,319


Return to How do I....?

Who is online

Users browsing this forum: guannstar, odiusfly and 23 guests