Trying to do something weird with sprite collisions.

0 favourites
  • 5 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I am actually attempting to make 2 instances of the same sprite behave like solids without using the solid behavior. Currently, they have a platform behavior attached. The sprites are being used as enemy containers, with spriter animation skin overlays positioned to both each tick. The problem I'm having is when the two instances of the the container collide/overlap. Sometimes when they literally cross paths, the instances "swap" skins because I'm using pick nearest to assign each skin to its container. It's happening far to often to ignore. I tried making each of them solid but combined with the platform behavior, it punches my frame rate right in the windpipe. I'm dropping form 58 fps down to 19 just by adding the solid behavior. I tried writing a collision action that forces the containers away from each other when they collide or overlap, but the problem I have there is that I'm using their traveling direction to determine which way they should "bounce" off of each other. If they both happen to be traveling in similar directions when they collide, weirdness happens. I've been running at this for two days, and I think I'm too close to the problem to see the solution right now. Any help will be greatly appreciated.

    http://www.crunchpickle.com

  • Instead of using pick nearest wouldn't pinning them work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I haven't used the pin behavior before. From my quick reading, it looks like it could solve the swapping part of the problem. I still need to keep them from overlapping/figure a way to properly bounce them off of each other on collision. It's largely a style decision, but I want the creatures to feel solid.

  • I can't have a look due to network restrictions, but would using is overlapping at offset or using a detector sprite in the direction of travel be of any help?

  • Possibly. I'll try pinning them together when I get home. It might make the rest of the problem easier to solve. Thanks for the tips.

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