Bullet collision...The best way?

0 favourites
  • 6 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Hi all

    I,m making a hokey game, and using the bullet behavior on the ball.

    But sometimes when the ball hits the edges its go through it, the edges have the soiled behavior.

    And the speed of the ball is just 1200, i think its not that much.

    Also i used the line of sight method, but without any success.

    Anyone have a solution or any other methods.

    Thanks guys for any help

  • Did you try creating large invisible rectangles for the edges? Make them wide enough so that the ball will never be able to go through them.

  • when something has the bullet behavior, it's not actually moving forward. it's more like teleporting forward however many pixels every tic (speed). so if it's moving 1200 pixels a second (isn't that the measure of the speed? pixels per second?), that's like 20 pixels per tic it's 'teleporting'. so if in a tic, your ball moves 20 pixels and that 20 pixels is enough to clear your edge boundary, then when the collision check happens, the ball is already on the other side of the edge.. so as Rable said, you can use invisible edges to make sure your boundaries are big enough to keep that from happening.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Post a capx and be sure to tag me with

  • One way is to check for collisions between positions like one of these:

    Another idea that i can't find an example for is to stretch a rectangle sprite from the old position to the new. Then if it collides you then can back the object up.

  • Thanks alot guys.

    I will post an update after i try the new methods.

    Tekniko

    The capx is very big, its a prototype for my new game.

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