How do I keep precise distance between objects

Get help using Construct 2

Post » Mon Jul 13, 2015 5:44 pm

Hi!

Let's say we have objects spawning every X seconds and then moving around a block (see attached picture). How do I make sure there is a precise distance between the objects? At first, spawning them every X seconds did provide an equal distance between all of the objects but later I noticed that sometimes there was a difference in the distance between them (sometimes they even overlap each other). So, how do I keep a precise distance between all of those objects and make sure it stays like this despite any conditions?

I'll appreciate any help.

Image
B
12
S
2
G
1
Posts: 41
Reputation: 1,442

Post » Mon Jul 13, 2015 5:47 pm

Could you record the X and/or Y value of the already existing sprite, then spawn to that position +/- the precise distance you want?

Spawn at position ExistingSprite.X-PreciseDistance, ExistingSprite.Y-PreciseDistance
B
11
S
2
G
1
Posts: 79
Reputation: 842

Post » Wed Jul 15, 2015 4:22 pm

ThomasP wrote:Could you record the X and/or Y value of the already existing sprite, then spawn to that position +/- the precise distance you want?

Spawn at position ExistingSprite.X-PreciseDistance, ExistingSprite.Y-PreciseDistance


I will try and see if it works in my case. Thanks!
B
12
S
2
G
1
Posts: 41
Reputation: 1,442


Return to How do I....?

Who is online

Users browsing this forum: ivanski1983 and 13 guests