Hi, I am currently trying to make an app that adds an object that bounces continuously without losing momentum. I don't have much experience with actionscript and even less with citrus. I am also having a problem with an mouse event listener added to my stage that is not detecting any mouse input. I am using flashdevelop. Any guidance would be greatly appreciated.
Citrus adding new bouncing objects repeatedly(5 posts) (4 voices)
I'm afraid we'll need more info for both of your problems.
Because of floating point errors, you'll never have infinitely bouncing balls with a physics engine unless you listen to collision event and apply forces manually each time so you can be sure that it won't lose momentum and override what the engine does. I think this is the best solution. But maybe you should explain what your app looks like to know if that is an acceptable solution for you.
Are you using starling? to what target is your mouse event listener registered?
Thanks for the response, I have been plugging away and managed a bit of a breakthough. I am using nape and I have it repeatedly creating a new box, the idea is to use it as a kind of benchmarker, seeing how many instances of an object can be added before it starts dropping frames. Now my problem is trying to get the nape bodies to not interact with each other and only interact with the static bodies.
Depending on complexity a custom solution could work much better than a physics engines. This is because you can take advantage of knowing more about your specific requirements than the engine can.
How many bodies are we talking about?
look at the Ball class
If you're making a mobile app, you should use Nape instead of Box2D.
You must log in to post.