0 Favourites

Need help with my game - CocoonJS

  • Hi,

    I have a problem i cannot fix <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad"> I have some micro laggs in my game. I have identify the problem with the wall creation (i guess ).

    Please test this to see it on your own: https://play.google.com/store/apps/deta ... se.levicat

    Every time the cat passes the obstacle a new one will be created out of the game and the passed will be destroyed if they reach x = -100 px.

    But nearly ever when a new obstacle was created i got a "micro lagg" <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">

    I also tried these tips.

    https://www.scirra.com/tutorials/298/pe ... bile-games

    Still the same issue.

    Some information:

    • Compiled with CocoonJS (Canvas+, 2.0.0-bate, same with 1.4.7)
    • Tested without any other objects, just the cat and the walls (same isseu)
    • FPS 60-63
    • Active objecs about 30-45

    Can anybody help me? Or have anybody a better way to handle the wall creation?

    Big thanks to you all looking into that <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Instead of destroying the one off screen and creating a new one, try just moving the off screen one instead. Of course you'll need to keep track of which one is next available for moving but an array should work for that purpose. Could remove the creation delay...

    In fact, that's just inspired me to see if I can do that to my work in progress as well!

  • Thanks Colludium,

    That's a great idea

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • OK, I just spent ages implementing a plan B to spawn all instances at the start of the layout and - I can't tell the difference (in chrome and cocoonjs)! So, back to plan A because it's easier to manage.

    It feels like there is a small spawning burden but it is only really noticeable when spawning more than one object. I try and avoid that sort of thing anyway and that's probably why I can't see an improvement (it was running pretty smoothly before). Science project over, back to actually trying to 'develop'....

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