0 Favourites

random create actor within distance

  • Hi, im creating a object inside the layout boundaries and using a random generator. Every 0 to 3 seconds i create one of these sprites. actually some sprites are created at the same spot that others.

    but i want that each object created do not be created over another existing sprite. there's a way to guess where the other actors are in the moment of creation and set some distance from the already created actors?

    tks

  • Hi, im creating a object inside the layout boundaries and using a random generator. Every 0 to 3 seconds i create one of these sprites. actually some sprites are created at the same spot that others.

    but i want that each object created do not be created over another existing sprite. there's a way to guess where the other actors are in the moment of creation and set some distance from the already created actors?

    tks

    Here is an example that does something similar, none of the sprites at the start are allowed to spawn on top of each other.

    Evil sprites demo

  • Hi Vee, tks for the help. I used your example but without success. i still dont understand what is that "pick instance 0" and i some of my objects are still overlapping the others. here is what i have done (see the pic) all of my actors are randomly created

    dropbox.com/s/53brakrhin4wf3c/overlaping.jpg

  • Pick instance 0 just refers to the first instance of that particular sprit object that was created. So lets say you create 3 actors on the screen. Each actor is referenced as an instance. So you would have that particular sprite object at the instances of 0,1,2 and picking the 0 instance is like picking the first of that same sprite object that was created. Well, I believe that's what it is

  • Whenever an sprite object is created it starts at an instance of 0 instead of 1, but basically what that example is saying, is that if cupcake is created, and if its overlapping another cupcake, then pick the 1st instance of cupcake (so the first one created) and change its position to a random spot.

  • tks for the explanation retrodude, now i understand a little more about this. and finally i had achieved what i wanted. ;)

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • My problem is, when my second people touch in the frist, the second stop and the next, stop too, but when the row is full, the last people go out (is a overlapping>foward to -30), but the row stop to walk...

    If, the people overlapping, the people distroy...

    Give me a dropbox acount(your login) and I will send a .capx

    My e-mail is moc.liamgcbc@32knilolbap ( in dropbox) <img src="smileys/smiley11.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
random bugs and suggestions
90 4,517
Tom's avatar
Tom Construct Team Founder
Unread hot topic
0 Favourites
Rep is very random...
73 17,907
allavett's avatar
allavett
Unread hot topic
26 1,893
MatthewdearGA's avatar
MatthewdearGA