CocoonJS Physics stops working?!? Please help!

  • I have made a bubble shooter. You swipe over the screen and after that the ball shoots. (via impulse at angle)

    Sometimes, after playing about 5 minutes I simply cannot shoot the ball anymore. It's like the ball is Immovable but its definitely not a wrong physics setting or enything else. All of the rest still works (Pause menu with buttons, sounds etc..) its still the ball which do not shoot. Sometimes it happens after 5 mins, sometimes after 15 and sometimes at the first start of the game. If I close the game and start it again it will work for another amount of time. This is both with the cocoonLauncher and exporter from xcode.

    I have tried Box2DWeb Physics, Box2D-ASM physics and cocoon physics. All the same. Only cocoon native physics not working (game doesnt start).

    I just dont know how I can resolve this. Cant send it to apple cause of that problem.

    Would be great If someone can help.

    Regards,

    Kraudi2k

  • Btw. What is the difference between Physics Impulse and Physics Force?

  • I have found physics on mobile browsers to not work very well and that includes on cocoonjs I'm afraid. Any fps slowdown changes the physics characteristics of the objects so object interactions are different each time you run the same scene and if you play on a different device. And collisions cause little slowdowns...

    I thought that only the cocoonjs physics worked on cocoonjs without causing crashing. Have you tried running a zip in the launcher in debug to see what errors are reported?

    As for impulse and force. Wiki might give a more detailed answer. Force pushes for the time it is applied in increments of one tick. An impulse should change a body's momentum as if a force was applied for a fixed time. In fact impulse = force x time. So, an upward force of 1 for 10 seconds will result in the same upward velocity as an upward force of 2 for 5 second or an impulse of 10 being applied.

  • Thank you. Yes I tried over the launcher with debug but there is no error at all. Thats what I dont unterstand. Exporter via xCode its the same. But as I told it happens completely random. Changed now from impulse to force but I have to to test it a couple of times to see If the problem still exists. Otherwise the game works at excellent fps from iPhone 4 to the newest devices. No stuttering and plays always the same with physics set to fixed.

    its just that damn random problem that exists.

    I also tried bullet instead of physics which works but as my ball is a circle it is not good with collisions on the edges of solids. Thats why I tried using physics

  • Have you a capx (or a screen shot of the spawn event at least) you are able to share? Is it possible that the ball is spawning inside another physics object? If you're pinning the previously spawned ball, is it possible that the pin action is affecting the wrong ball (just a guess but I've had that happen!)?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The ball is already placed on the layout (different starting position for each level)

    here is the swipe events

    may you find something:)

    strange is. exported via node webkit and all works fine.. no problems with ball not shootable.

    Edit: Tested now 10-12 times with force instead of impulse and it works. Dont know if its luck or a solution.

  • Nothing stands out - it all looks OK to me. Don't know why force would work where impulse won't. Could be that giving an impulse so close to enabling physics movable was the problem. If you get a problem with using force you could try setting the velocity instead... I'm glad it seems fixed though!

  • It happened again. Damn!

    Edit: Added some debug stuff and found out when the problem happens the "On any touch start" will be activatedd but the "On any touch end" not. But I don't know why and why it does not work again when I restart the layout.

  • Yes, there is a issue to the cocoonJS native phyiscs. Only the Box2D web engine works. Maybe asm to, but not tested.

    @ Scirra: Please clarify with ludei. thx

  • Im using the Box2D

  • Problem still exists. Keeps me from releasing it to the Appstore. Sucks.

    Have you a capx (or a screen shot of the spawn event at least) you are able to share? Is it possible that the ball is spawning inside another physics object? If you're pinning the previously spawned ball, is it possible that the pin action is affecting the wrong ball (just a guess but I've had that happen!)?

    And yes. My ball is inside another physic object but not in a polygoned area so there shouldnt be a collision at the start. also ball is not created at start(its already positioned on the layer)

    Which alternatives do I have instead of physics? Bullet works but has bad

    collision checks on circul balls. its a top down puzzler (like a topdown pool game)

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