how can i improve bullet bounce?

0 favourites
  • 9 posts
From the Asset Store
Bouncing ball
$9.99 USD
Template for a bouncing ball game, fully documented in comments and video
  • watch this

    hello, can i optimize the bounce of this bullet behavior?

    I find this slightly detailed bounce bug getting weird

    I've fixed a collision like this

    but is there a more effective way?

  • What's the collision box on your tiles look like? I'm going to guess you'll be better off with square collision boxes.

  • You could also change the bullet behavior property to not set the angle of the object when it’s moving. It would make the collisions more consistent.

  • What's the collision box on your tiles look like? I'm going to guess you'll be better off with square collision boxes.

    oosyrag

    yes indeed I set it to be a perfect square, but I use the tilemap object to create the platform

  • You could also change the bullet behavior property to not set the angle of the object when it’s moving. It would make the collisions more consistent.

    R0J0hound

    I've tried turning off the properties, and I think it's more consistent, but after trying many times it's still the same (watch this video)

    and the new main problem is that I can't aim my shot

  • Do you have physics enabled somewhere?

    Hard to guess what's wrong without seeing your project. But something is definitely not normal. As far as the bullet behaviours bounce by itself goes, it should not be doing that.

  • Do you have physics enabled somewhere?

    Hard to guess what's wrong without seeing your project. But something is definitely not normal. As far as the bullet behaviours bounce by itself goes, it should not be doing that.

    oosyrag

    I don't use physics anywhere, and I always minimize the use of physics.

    actually this problem I often find since I use C2

    only bullet behavior and enable solid bounce off property

    --------

    I made a simple example, please check and experiment with this bug '-'

    dropbox.com/s/rmxcvmttassmho1/tes%20bullet%20bounce.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I mean you can fiddle with the collision more. It may work better if the ball has a box collision and isn't rotated at all. You can use the "set angle of motion" to let you shoot where you aim.

    If the bullet behavior's bounce still isn't acceptable you can use the physics behavior instead to move the ball. Give the tilemap and the ball the physics behavior, make the tilemap immovable, and when you launch the ball you'd set it's velocity with:

    set velocity to (speed*cos(angle), speed*sin(angle))

    You may need to fiddle with some of the ball's physics properties to tune it. Stuff like collision shape and elasticity. You may need to disable collisions between balls or change the gravity with events.

    If that still isn't satisfactory you can calculate the surface normal of a collision and do the bounce with math. Here it bounces a perfect ball with a tilemap. This gives more control but isn't as simple to drop in.

    dropbox.com/s/r7ptcicrw0k753w/bounce_sdf.capx

  • I mean you can fiddle with the collision more. It may work better if the ball has a box collision and isn't rotated at all. You can use the "set angle of motion" to let you shoot where you aim.

    If the bullet behavior's bounce still isn't acceptable you can use the physics behavior instead to move the ball. Give the tilemap and the ball the physics behavior, make the tilemap immovable, and when you launch the ball you'd set it's velocity with:

    set velocity to (speed*cos(angle), speed*sin(angle))

    You may need to fiddle with some of the ball's physics properties to tune it. Stuff like collision shape and elasticity. You may need to disable collisions between balls or change the gravity with events.

    If that still isn't satisfactory you can calculate the surface normal of a collision and do the bounce with math. Here it bounces a perfect ball with a tilemap. This gives more control but isn't as simple to drop in.

    https://www.dropbox.com/s/r7ptcicrw0k753w/bounce_sdf.capx?dl=1

    wow this is the most stable bounce behavior i've ever found in construction, and you made a physics manual, looks good, thanks R0J0hound i'll learn this more

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