Non-overlapping random spawn

For questions about using Classic.

Post » Wed Feb 27, 2013 6:53 pm

Hi there,

There's an area with multiple image points. How can I make it spawn new sprites at random image points over time so that these sprites do not overlap each other (i.e., appear at the same point)?

Thx in advance.
B
3
Posts: 1
Reputation: 409

Post » Fri Apr 12, 2013 11:03 pm

bump

Using this post, and because I need something similar but I cant find the right logic:

How do I make a random spawn of 4 numbers in 4 different but fixed positions without repeating themselves?
In other way I want them to spawn in a,b,c and d positions randomly but never overlapping.

I found a rudimentary way to do it with a "set position" x=CHOOSE(128,384,640,896) and every time they overlap its forced to choose another place to be. This repeats 4 times for each number. It works but it seems very badly done. It brings me further problems when I want 10 numbers in 10 random fixed positions... its huge!

I have this feeling that this is done with an array, but I don't know how to use it here.
B
4
Posts: 4
Reputation: 708

Post » Sat Apr 13, 2013 12:44 am

You want to create 1 object per position or just don't want to repeat the last position?
Anyway I try to make a cap, maybe it's not the best method but I use array to achieve this.

https://www.dropbox.com/s/qqiyz0mt5o2j6wb/Non_overlapping_create.cappoewar2013-04-13 00:44:38
B
7
S
2
G
1
Posts: 21
Reputation: 692

Post » Sat Apr 13, 2013 7:03 pm

How do I open your .cap file?
My Construct2 does not accept it...
B
4
Posts: 4
Reputation: 708

Post » Sat Apr 13, 2013 10:25 pm

Pmmm, You need to install construct classic to look at the cap. You are in the construct classic section which is different than the construct 2 section.
B
10
S
3
G
1
Posts: 103
Reputation: 1,390


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests