krish's Forum Posts

  • Alrightly, found it.. sending jsons via variables.

    Thanks :)

  • Guys,

    What is the proper way to make an ajax post call to an url with jsonData like

    { "my_name": "superman" }

    Right now I'm using something like

    Ajax post ->

    tag - foo

    url - myurl/parser.php

    data - ""

    Which obviously means my parser.php needs to reconstruct that url into a json.

    Is there a better way?

    thanks,

  • I have an include "anothersheet" at the top of a layout.

    And the "anothersheet" uses json loading into hashtable via ajax.

    Happen to notice that

    1. If you try to push "preview" from construct 2 when the browser is already running preview ...the preview reloads but the include doesnt run / ajax call is ignored?

    Because the JSON values all become zero!

    2. Even if you browser refresh the layout its the same case.

    3. "Restart" layout also doesnt probably call include / ignores new ajax call and uses cached values.

    Because try having a key for restart layout (say Esc).. and change the json on the fly, then press Esc.. it still uses old values.

    A work around for point#3, is to use On key pressed Esc -> Go to layout "samelayoutname" instead of "restart layout" .. that seems to make a fresh ajax request.

    So far, I haven't found a workaround for point #1 and #2.

    Any sane reasons why this is so?

  • I looked through the code, and it doesnt look like it will call a json which is not on same domain as c2 app.

    This is the shortcoming of JSON.

    XMLHttpRequests can only be made to URI's on the same domain.

    You'll need to use something like JSONP that uses "<script>" to do that.

    Almost tempted to try add that to plugin, but way short on time right now :(

  • thank you :)

    Will check.

  • Hey guys, in a vertical scroller.

    How do you generate a continuous building on texture rolling upwards.

    Any examples I can take a look at :/

    Thank you.

  • nice plugin

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One tricky way is to probably spawn the player at the center of the screen :)

  • Wondering if there is a better way to make a whole layer to scroll in a side scrolling shooter.

    Right now I am moving a parallax layer by self.X-8*dt and the player itself with self.X+self.xSpeed*0.1*dt on every tick.

    The problem as I see is that I dont move the object layer where the game level difficulties are designed (parallax 100,100) and hence it only moves when the player reaches the center of the screen and so on.

    Is there a better way?

  • Aw... so the scaling happens on the actual sprite size and not instance 0 :P .. Oops my bad.

    Thanks everyone for the reply.

  • My thoughts on Ideal Game Level Length and how I figured it out for "Tank 'em Up" <img src="smileys/smiley1.gif" border="0" align="middle">

    Also another sneak-peek of the game <img src="smileys/smiley2.gif" border="0" align="middle">

    blog.toonheart.com/ideal-game-level-length/

  • I have this bullet which I say scale to "1.2" when fired.

    And the darn thing looks like a dinosaur egg size (almost 2 - 2.5x times) the actual sprite.

    and same with any scale .. 2x looks more like 4x.

    Anyone else having similar issue?

  • Thank you rfisher

    This helped :)

  • One of my future games will need to use accelerometer and gyroscope; so I will need to build a prototype anyway.

  • I will probably.

    Thinking of another prototype in pipeline.