Problem with bullet collisions with solids

0 favourites
  • 8 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Hi, i want to make something like breakout or arkanoid so i made a prototype but i have some problems.

    I used "walls" that are sprites with solid behavior, and a ball that is a sprite with bullet behavior.

    The problem is that the physics arent realistic, for example, if the ball moves horizontally near the floor, and hit a wall, the logic is that the ball change the direction (from 0 degrees to 180 degrees) but the ball bounce in a strange manner and moves vertically near the wall. Another thing is when the ball hits a brick and the direction after the collision is wrong.

    Capx with the first example:

    dropbox.com/s/el0kg1drxh7kizo/test.capx

    I tried changing the collision polygon but its the same. Any ideas for a realistic physics in this case?

    P.D.: Sorry for my english :D

  • nobody?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sometimes it takes awhile for someone with the time to look over a capx to get to it. Work, life, etc... tend to take precedence... don't worry, I am sure someone will get to look into it... usually I find that it has to do with the overlap of the solids or the shape of the collision polygon. If you draw a circle in paint, or something else and save it as a png with transparency and import it as your sprite, do you get the same behavior? Drawing your collision polygon in Construct still tends to have corners instead of real round edges...

  • I tried with diferent polygon shapes, thats the first thing that i thought but all work the same. I tried without overlapping solids like you said, but the bounces didnt change neither :(

  • Have you looked at the Breakout tutorial?

    Breakout

  • Yes, its harder to test but happens the same, if the ball go parallel to a wall, when it bounces with the next wall the bounce its in 90 degrees, not in 180 degrees.

    And the wrong direction after a collision with a brick happens too.

  • How about something along the lines of:

    <img src="http://blackhornettechnologies.com/Construct2Stuff/non90.png" border="0" />

  • Hey!

    6 years later I have an answer for you.

    Do not use the Bullet behavior. Instead use the Physic behavior with a World.gravity set to 0, damping to 0, elasticity to 1, and the collision mask to circle to simulate the Bullet behavior.

    It'll work like a charm.

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