Juanito-cnstrct2's Forum Posts

  • I have looked into that before, trying to use the C2 behaviours in Unity.

    Unity's javascript is not the web's javascript. One of the main differences are prototypes, Unity's javascript does not support them.

    So, yes, like Ashley said, it would require some major rewrite.

  • I read Ashley's really good article at m.netmagazine.com/tutorials/make-your-javascript-apps-smoother . He suggested avoiding creating objects too often in Javascript.

    My question is, at a higher level, in Construct2, should we also be avoiding creating/destroying too many sprites on the fly and instead have a "pool" of them that we can re-use?

    A good example are bullets, which get created and destroyed very often.

    Obviously the answer might be "depends", I just wanted to make sure there is nothing in the Construct2 engine already doing the "pooling" of sprites and objects for us.

    Thanks!

  • I have an ARM surface tablet (WinRT)

  • shreedharcva thank you! that helped me fix my Win8 game that also uses the TMX importer.

  • dusoft : probably not because it uses the same techniques as the official plugin.

  • I have not tested windows 8 rt, but it works on chrome on win 8 desktop version

  • I ran the space blaster game at bestbuy on a vivo rt tablet. It did not go above 8 fps. However the yoga tablet (x86) had absolutely no problem staying at 60 fps.

  • I am working on making Construct2 work with Ejecta. So far a was able to get a primitve C2 game that displays text, moves a box with 8-dir behaviour and touch input (http://www.scirra.com/forum/topic60309.html). The nice thing with Ejecta is that it is open source and has some GameCenter support already, so in theory you could add your own JS bindings/plugins using Objective-C.

    Performance-wise is about the same as directcanvas.

    Best of all, vikerman is working on adding webgl support to Ejecta. If people help him, he might be able to complete the webgl implementation.

  • Never mind, I was able to make a simple C2 game work in Ejecta.

    I had to do the following:

    1. export as Html5 game

    2. Modify runtime.js in the following places

    a. set this.isDomFree = true and this.isiOS = true in function Runtime(canvas)

    b. set this.ctx = global_ctx; in function Runtime(canvas). global_ctx is just an arbitrary global var that holds the 2d context obtained in the index.js script (see Ejecta documentation). That was the only way I could make it work, not sure why.

    c. always return true in areAllTexturesLoaded. The loading progress logic did not work for me in Ejecta. As a ugly work aorund I just set it to return true. Obviously, this could create problems for games that load a lot of textures.

    3. Create a index.js file for ejecta with the following contents:

    var global_canvas = document.getElementById('canvas');

    var global_ctx = canvas.getContext('2d');

    ejecta.require('c2runtime.js');

    // Create new runtime using the c2canvas

    cr.createRuntime('canvas');

    Please see Ejecta documentation for additional steps required for ejecta to work in Xcode.

    As Ashley said, you need a mac to use Ejecta, but then again, you need a mac anyways when uploading the final version for publishing in the app store.

    For me the biggest advantage of Ejecta over Cocoon or AppMobi is the already available integration with GameCenter. other than that, I think they perform the same. The other biggest possible advantage would be WebGL if vikerman is able to complete his amazing Ejecta webgl bindings.

  • A little bit off topic, but Is anybody working on an "unofficial" way to run c2 games in ejecta? I tried it and with minor tweaks to the rintime.js, i was able to get ticks and draw calls but the sprites are not drawing on the screen. I know for sure that the sprite's draw function is being called with the correct params because i added a console.log right before it. All i get is the white background from the layout.

  • remy-jay I think JohnnySheffield's version (http://www.scirra.com/forum/plugin-zack0wack0s-socketio-mod_topic56503.html) fixes this issue.

    I think you can also add the disconnect event and adding an action there to disable the ondata received event (system->disable event group). You will need to put the ondata received in its own group.

  • Mainly performance. The link says that the Cocos2d approach could be faster than DirectCanvas, but again they don't show any numbers so they could be just making that up.

  • I noticed that Cocos2d (a mobile, native engine) has a Javascript binding:

    github.com/cocos2d/cocos2d-iphone/wiki/cocos2d-and-JavaScript

    I was thinking that maybe, instead of accelerating the mobile games at the low Canvas calls level like AppMobi probably does, Scirra could create a special Cocos2D based runtime that would accelerate at the entity level (sprites, backdrops).

    My guess is that the Cocos2d JS bindings would allow most of the JavaScript in the runtime and the plugins and behaviors to "just work". any Input or sound related javascript would have to be specially handled at the C2 runtime level, but I guess that is also a requirement in DirectCanvas. Any custom plugin or behavior that relies on canvas or webgl calls would also have to be converted, but I think that is a small percentage of the user-created plugins.

    I understand that such an exporter would not have all of the plugins and behaviors of the HTML5 engine, but neither does DirectCanvas and I would think that the Cocos2d exported games would perform faster than the DirectCanvas.

    What do you all think?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • zingzong it is possible in the sense that you can have something working after spending a good deal of time. You will also need to come up with a way of translating the logic of the game into the Events/Actions. There is not a "strategy template" or "strategy unit" that come with Construct2.

    I do however suggest that you start with something simple, as in a small strategy game where the player click on a unit in a small square grid and then moves one square only. With simple attack/defense values stored in instance variables.

  • Anggi do you have Chrome? can right click the page-> inspect element and then check the console tab. What does it say?