Xavier's Forum Posts

  • I'm wondering if maybe this is a C2 bug so I'll post it here for now.

    For some reason when I use an XML XPath expression with the asterisk attribute, nothing shows up on Internet Explorer, this same expression works in Chrome and Firefox. (See the provided .capx)

    Additionally, if I use an online XPath evaluation tool with the same expression, it shows the correct result in Internet Explorer. That's why I'm wondering if either I'm doing something wrong or it's a bug with C2.

    This is tested with the latest stable and beta C2 version and IE11. What do you think?

  • I had this problem some time ago, this is how I solved it.

  • Thank you.

  • I would like to list the contents of an array on the x dimension but exclude the cells that are empty (0).

    So if I have an array of words like this [Play] [0] [0] [Fire] when I display them this is what happens:

    Play

    0

    0

    Fire

    What I need is:

    Play

    Fire

    Thank you.

  • Link to .capx file (required!):

    Open Lighting.capx on the C2 examples.

    Steps to reproduce:

    1. Test with debugger on Chrome and move the cursor around.

    2. Try both canvas2d and WebGL and observe CPU utilization.

    Observed result:

    Cpu utilization with Chrome on WebGL is much higher (20%) than canvas2d (0-1%) even with a fast cpu.

    Expected result:

    At least the same performance than canvas2D or better.

    Browsers affected:

    Chrome: yes

    Firefox: no

    Internet Explorer 11 Preview: no

    Operating system & service pack:

    Tested on:

    Windows 7 Prof. 64 bits

    Windows XP 32 bits

    Construct 2 version:

    Tested on:

    r141 beta

    r139 stable

  • This was covered in the C2 class this past weekend, you might want to watch the video here where Yann shows how to stomp enemies:

    http://www.scirra.com/forum/construct2-live-class_topic65550_post409490.html#409490

  • This is actually not hard to do, you just need to use the plugin that jayderyu mentioned. Then it's as easy as adding the "Execute" action from that plugin to any part of your game. For instance, after a button is pressed, add the CallJS execute action and enter one of the names of the javascript functions the publisher needs, like "PUBLISHER_SUBMITSCORE()".

    You don't need to do anything else.

    As for the function to start the game it's a bit more technical but still easy. You can't add that function inside C2, you need to add it after you export the game by editing the index.html with a text editor. You only need to make 1 edit:

    Find the line: // Start the Construct 2 project running on window load.

    There you'll find the following code:

         

    jQuery(document).ready(function ()
              {              ?
                  ?// Create new runtime using the c2canvas
                  ?cr_createRuntime("c2canvas");
              });
    

    You need to replace all of that with this new code:

         {              ?
         function PUBLISHER_GAMESTART()
    {
       jQuery(document).ready(function () 
                  ?// Create new runtime using the c2canvas
                  ?cr_createRuntime("c2canvas");
              });
    }
    

    On the new code, replace PUBLISHER_GAMESTART with any name you need for the function to start the game. Everything should be ready after that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think if you put the spawners in a family, and then use the family for the spawn action it will pick a random spawner from that family.

    Also, you can use the system condition "Pick random instance".

    https://www.scirra.com/manual/124/system-conditions

  • It's really hard to give you advice if we can't see you project file.

    CocoonJS is still being developed and hopefully in the near future we'll have a webgl export, that will probably boost the fps even more.

  • Does anyone know if there is a way to speed up the physics on the handsets? I've removed most of the iterations on physics checking, and it is still slow.

    The rest of the app is normal speed, but Physics calculations are in slow motion, As if gravity was 1/4 or something.

    I don't know how to compensate for that. The collisions seem to be fine, but the speed at which objects fall is much slower on the handsset than desktop. I feel like this could be fixed with some mulitplier or DT calculation. Anyone have any thoughts on this?

    I think maybe you're looking for this:

    https://www.scirra.com/manual/98/physics

    Read the "set stepping mode" part.

  • Actually family behaviours were added a long time ago, what was added in the latest beta is the replace object which is something different, but thanks anyway.

  • Take a look at the browser object in the manual.

  • Did you change the sampling from linear to point?

    https://www.scirra.com/manual/66/projects

  • If you use pure HTML5, you can use an iFrame plugin like Pode's HTML pack:

    http://www.scirra.com/forum/plugins-pode-html-pack_topic51522.html

    Then register to an Ad network, and use the code they'll give you on the plugin.

  • I have a doubt with this.

    I?m making a RPG game with larges arrays to Player info, Inventory, Objects info, etc. If I need save all the whole information with WebStorage, I need save data by data on separated keys?

    I?m download the .Capx example and I modify that to use arrays:

    Example with array

    If that works on this way, is a really boring and hard work.

    Is some other way to save this type of data?

    To save an entire array to webstorage, use this simple method:

    http://www.scirra.com/forum/saving-and-loading-an-array-to-webstorage-capx_topic50970_post353466.html#353466

    http://www.scirra.com/forum/copy-an-entire-array_topic53153_post332888.html#332888