How do I optimize my bouncing behaviour (See capx)

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

    I made this bouncing behaviour for a ball (see capx). The problem is that it checks for a lot of collisions, on average 1.200 per ball at least. In my game I sometimes have up to 15 balls on screen, so my collision checks (in debugging) are between 15.000 and 25.000. How do I lower these, because my game crashes.

    I tried:

    1 make collision check sub event, real event is when ball is below x

    2 make collision check sub event, real event is when ground i in line of sight.

    Both didn't have a big impact, I only could lower the collision checks with 100-200 per ball, so there still are at least 1.000 checks per ball.

    Help is appreciated!

    Thanks,

    Daan

  • Adding Trigger once condition in the 5-6 sup events, will help you but not much.

    have you tried to change the behavior, maybe it's from the platform behavior.

  • Adding Trigger once condition in the 5-6 sup events, will help you but not much.

    have you tried to change the behavior, maybe it's from the platform behavior.

    Hi, thanks for the reply

    I tried chancing the behaviour by getting rid of the the instance variable action and replacing it in the event by a mirrored or not. No change.

    But I have no clue how i can get rid of the platform behaviour and get the same results. With a bullet it keeps spinning.

  • Anyone??

  • Try this.

    the cap file fix:

    https://www.dropbox.com/s/e92tfy9e5y105 ... 20Fix.capx

  • Try this.

    the cap file fix:

    https://www.dropbox.com/s/e92tfy9e5y105 ... 20Fix.capx

    Thanks for your input,

    I tried that one before, but the problem is that they don't bounce synchrone. As soon as the ball hits the wall it starts to bounce random. I need to be able to walk underneath it. The balls should stay the same jump height and at the same pace, so almost precise as my current ball. However i found out that it is the platform simulate key, that causes all the collision checks.

  • I do not understand exactly what you want to do. placed an image illustrative.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I do not understand exactly what you want to do. placed an image illustrative.

    The ball is an enemy that goes from left to right, and back. He must jump like i did before, so his jumping heigt and his speed should remain the same. So it should jump the 50th seccond the same way as the first seccond. It should stay move between the two walls. So actually everything should stay the same, only it should i want to lower the collision checks.

  • I would like to help you, but I understood nothing.

  • You should look at the sine behaviour:

    https://www.scirra.com/manual/103/sine

  • Try this example with bullet behavior "Low fps" :

  • Try this example with bullet behavior "Low fps" :

    thanks for your help, but it is not working for me. With the bullet behaviour the ball bounces doesn't bounce in a steady pace. If you watch like 40secconds the ball actually is hardly bouncing but is going over the ground.

    I guess there is no solution.....I don't get why simulate right/left in platform behaviour costs so much collisions checks...

  • You should look at the sine behaviour:

    https://www.scirra.com/manual/103/sine

    Thanks for the input. Never used that before. How should i use it to make to same bouncing behaviour as in my example?

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