How do I avoid sprites to be overlapped

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • 99Instances2Go

    rojohound

    Hello guys!

    Its a few steps, until i can finish my project. And today ive got a question about avoiding overlapping sprites. Of course there is a event "on overlapping with object X". But let me explain the situation.

    ive three doors on which i spawn (create) sprites. In round 3 i spawn 3 sprites on each door in a random area ive created (this works perfectly). But now it can happen, that this sprites will overlap themselve, which is very bad, because you have to recognize the symbols of each sprite.

    ive tried a lot to solve this problem, but it doesnt work. Below this post, you can see an image of my events, and how i did it. My event checks in second instance if the sprite is overlapping with another sprite (the sprites are from the same sprite object - with differend animationframes)

    But i dont know why this second event instance is never called (see the picture). Does construct dont recognize overlapping events if its the same object?

    Image:

    postimg.org/image/hxu26j1dz/

    Much of thanks to all!

    Best regards!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry, I had a quick look at the image but wasn't able to fully understand it because I was in a hurry, buuut... A quick and dirty workaround is to reposition the sprite if it's overlapping another one. Something like,

    If Sprite overlaps Sprite + Pick 2nd instance of Sprite --> Set position to random

    This way it'll keep moving the sprite if it's overlapping another, so eventually it'll end up with them not overlapping.

  • Sup with that?

    I solved it a little bit differend... On the spawning part - i splitted the spawning area via code into 3 differend areas to determine overlapping issues - this works perfect. Another solution with the "on overlapping" event still doesnt work.

    Thank you very much Sup with that for your idea!

    Best regards

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)