Problem with collisions and bullet behavior

0 favourites
  • 6 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Use the bullet behavior to give movement to the enemies. The issue is that sometimes I can not detect collisions and still long for offscreen.

    It is not the first time it happens ...

    How I can fix it?

    https://db.tt/eNT2w6he

  • Your link doesn't do anything on my system. It just opens a black screen. Can you post a capx so to have a closer look?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wenaptic this isn't a problem of the bullet behavior, it is a result of the way you've set your system. The collision polygons of both your sprites are too small and after a while the sprites miss each other.

    I' am sure that there is a better way to achieve the result you're after but I can't quite envision it. A quick fix using your setup would be to reset the Sprite's collision polygons back to full size and add a small delay before each angle of motion change. A wait action of 0.2 seconds looks ok for your bullet's current speed.

  • I had a quick tinker with the events and hope this makes sense. There was no need to have so many separate trigger events checking the sprite variable so I grouped them together under one trigger. It's also worth noting that there is a small overhead for redrawing the text object every tick (as I understand it) - you only need to command a change to the text whenever you change the text content (I've done that by using a function rather than duplicating the text-update event).

    Edit to add that I increased the size of one of the collision boxes which is why the buggy collisions are fixed.

  • Wow! The code is more readable! I must work on my logic. Now I found no "bug". Thank you very much.

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