R0J0hound's Forum Posts

  • It would be hard to manually position the blocks. It's a bit better if you use qarp() to do a bezier to position them, but it's still a polyline instead of a curve. You could increase the number of blocks to make it smoother so the ball wouldn't jump.

    dropbox.com/s/fusvas0j62nf3e2/bezier_slope.capx

    I suppose you could change the collision polygon to be curved but it would be very hard to get it perfect.

    A better solution would require rolling your own collision detection and collision response with events so you can use beziers for collisions.

  • It was always like that. Adjacent sprites count as overlapping. You can either alter the collision polygon to be a little smaller or change the red's size to be smaller before checking for an overlap and then changing the size back so there is no visible gap.

  • irina

    Not a bug. In C2 events are run top down so both "double tap" conditions are triggered. Fix it by using "else" instead of "double tap" twice.

    On double tap

    --- dragging = 1

    ------ do something

    --- else

    ------ do something else

  • Why isn't it smooth? I'm pretty sure it has to do with how the browsers handle the rendering.

    Independent of C2, motion still isn't buttery smooth, well at least not on my pc. Part of the issue is graphics card support, mine for instance has bugs in the driver and ati won't be making an updated driver for a ten year old card.

    Here's a very simple js test where motion still isn't smooth:

    viewtopic.php?f=147&t=115540&p=835995&hilit=jsfiddle#p835995

    I'm pretty sure Javascript isn't to blame. I was able to get smooth motion in my now stalled wrapper experiment, in which I still used javascript, but implemented my own crude renderer on top.

    Reducing the framerate doesn't fix the lack of smooth motion.

    There was a discussion before of adding a 30fps mode, but it didn't work out as I recall because it wasn't smooth and had an unstable framerate.

    Anyways I found this page describing a way to use a fixed framerate, so I took a gander at editing the C2 runtime to implement it.

    http://stackoverflow.com/questions/1951 ... pplication

    It seems to work alright, at least for me. It still has little pauses on my pc, but it's at least as smooth looking as it normally is on my pc.

    These are the changes to limit the fps to 30, if anyone wants to test it.

    file: \exporters\html5\preview.js

    "..." is any number of lines, for this you'll want to find the line with "Runtime.prototype.tick". Bold are added lines. I prepended "rojo" to the variables I added. If it breaks, then just re-install C2 to fix it, or you could backup the file before editing it.

    ...

    var rojoThen = cr.performance_now();

    Runtime.prototype.tick = function (background_wake, timestamp, debug_step)

    {

    ...

    var rojoDelta = nowtime-rojoThen;

    var rojoInterval = 1000/30;

    if (rojoDelta >= rojoInterval)

    {

    rojoThen = nowtime - (rojoDelta % rojoInterval);

    raf_time -= (rojoDelta % rojoInterval);

    // Execute logic

    this.logic(raf_time);

    ...

    this.logictime += cr.performance_now() - logic_start;

    }

    };

  • andreyin Colludium

    You can use the system:snapshot layout action to do it. Just set the canvas size to the same as the layout, wait a frame for it to update and then save snapshot.

    Tested to work here with a 4000x4000 layout.

    https://dl.dropboxusercontent.com/u/542 ... ayout.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • andreyin

    Sorry for the late reply. The saved file should open. Now the file may be a blank image, though. I wasn't able to get the action that copies from the canvas to be reliable all the time.

    On another note the load texture from canvas action only loads what's on screen. Or should if it's working

  • You could use the repeat condition with a very high number.

  • Wololo

    Motion is basically object's teleporting from one position to another each frame. The issue is when the cog spins fast the wall is on one side of the object one one frame and the other side on the next.

    Solutions to solve this either use:

    * math to calculate if the paths of the two objects cross

    * or checking positions in between the frames.

    Here's a rough idea of the latter:

    https://dl.dropboxusercontent.com/u/542 ... tween.capx

  • A search for "isometric sorting" or "filimation engine" can give approaches similar to what you want. Based on what you know any two objects can be sorted based on their x,y and z. One thing to think of is they only need to be sorted if they overlap visually. To sort the objects it basically means a "topological sort" of the objects. A way to reference two separate instances of the same object is to use a family, then you can pick one instance like normal and the other with the family.

    I've done it before with isometric. The only difference to your idea is how you'd compare the two instances to see which is in front.

    viewtopic.php?f=147&t=79043&p=648340&hilit=isometric#p648340

    I found it can be made faster if you use an actual topological sort algorithm

    https://dl.dropboxusercontent.com/u/542 ... test2.capx

  • Tombas

    It looks like Euler looking at the source.

  • Barye you wouldn't happen to be using the "OR" condition would you? It is known to cause crashes when changing layouts in CC.

  • miketolsa

    There is no documentation written, although the official documentation can be referenced for some info since a lot of it is the same. There are a lot of little documentation tidbits in the descriptions when adding conditions, actions, and expressions.

    You'd have to try it and see if it performs better. I haven't used any mobile exports at all.

  • You mean heavy on cpu usage? Test it and see how heavy it is. Setting the force is basically just setting a number and has a negligible performance impact.

  • It's possible in theory, but in practice it would be hard to get it to the point where it works the same as it does in javascript and html5. Not to mention it would be hard to update it to stay on par with c2 releases.

    Now if you utilized a javascript engine like v8 or spidermonkey you can get most of the way there with most of c2's runtime running as is you just need to impliment html5 stuff like images,canvases, input, etc in c++ or something.

    I was able to do that with a couple hundred lines of Python with v8 and sfml as the input/graphics backend. It just runs an html5 export to do it. I've been meaning to covert it over to c++ to eliminate the overhead of Python. But anyway the idea is to just impliment the system specific stuff in c++ and run everything else with js.

  • For that you could use Bresenham's line algorithm for a nice result. But it isn't simple.

    You could use lerp to do it like this:

    https://dl.dropboxusercontent.com/u/542 ... _step.capx

    but you'll have to handle the case when deltay is more than deltax and do the loop in that direction.

    Edit: actually this would do it:

    variable delta= max(abs(x1-x0), abs(y1-y0))/32

    repeat delta times

    --- create sprite at (round(lerp(x0, x1, loopindex/delta)/32)*32), round(lerp(y0, y1, loopindex/delta)/32)*32)