R0J0hound's Forum Posts

  • Arima

    Fixed, just re-download the plugins. ".alphaAt" wasn't correctly implemented and the other problem was an issue of pre-multiplied alpha.

  • jayderyu

    The plugin has a .imageUrl expression to get a link to the image and you can then download it using the "invoke download" action of the browser object.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you see "e+21" at the end of the number it means the number is being displayed in scientific notation. So 1.002003004005006e+21 means 1.002003004005006*10^21. Any digits before "e" are the significant digits and with JavaScript numbers you get about 17 significant digits.

    Here is some psuedo code for a function to convert any number to currency format text.

    function format(num)
       if num >= 1000 then
          return format(int(num/1000)) & "," & zeropad(num%1000, 3)
       else
          return str(num)
    end function
  • If you can move an object from one point to another then all that's left is to move up and down as well.

    With this formula as a base for the parabolic motion:

    1-4*(x-0.5)^2

    Here's a capx:

    https://www.dropbox.com/s/cpzg482vpmatb ... .capx?dl=1

    /examples21/leaper.capx

  • I missed a comma there between "runtime" and "constants". 64999966 and 1000000 are constants. By collapsing I mean that 64999966/1000000 is replaced by 64.999966 to avoid needless calculations. The thing to note is the calculation is done before runtime, which is where the issue seems to lie.

    By using a variable between two constants the calculation is all done at runtime.

    And yes by doing the second bit it does give the correct output.

    See the bug report for a capx:

    http://www.scirra.com/forum/constant-folding-percision-issue_topic84055.html

  • Link to .capx file (required!):

    dl.dropboxusercontent.com/u/5426011/bug/bug_constant_folding.capx

    Steps to reproduce:

    1. Run capx.

    Observed result:

    Global variables a and b have different values.

    "a" is set to 64999966 / 1000000 and later reads as 65.

    "b" is set to 64999966*one / 1000000 and reads as 64.999966.

    "one" is a global set to 1 to bypass "constant folding".

    Expected result:

    I would expect both expressions to evaluate to 64.999966 and not just b.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: untested

    Operating system & service pack:

    Windows vista sp2

    Construct 2 version:

    r155

  • It appears to be a bug that probably should be reported. This is what CC did which I'm pretty sure C2 does as well: When the events are processed to be usable by the runtime constants in expressions are collapsed. So "64999966 / 1000000" is evaluated and the result is used in place. I suspect some lower precision math is used there. Once past that there is no issue with math in JavaScript because numbers are represented by 64bit floating point values to the best of my knowledge.

    You can also prevent constants from being combined when exporting and previewing by making a global number called "one" with a value of one and use that global in between constants. So your expression would look like:

    64999966*one / 1000000

  • You can do a smooth transition from side to top in c2 with a formula to rotate a point in 2d.

    http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/2drota.htm

    Here's it in action using pre-rendered sprites for the ships.

    https://dl.dropboxusercontent.com/u/5426011/examples21/shooter_rot.capxr155

  • Just pick the slid_line you want and use it's slid_line.value variable.

  • Yeah with a quick look over the main thing you missed was adding a "-" inside the sqrt. Without it you're calculating the sqrt of a negative number which is NAN. I can look over it better tomorrow.

    What's the formula calculate?

  • It's just a unique number for each combination of doors. There are 16 combinations and with the formula you'll get a value from 0 to 15 depending on the exits.

    The only thing that matters with this is the same value will be calculated for rooms with the same exits. Which exits doesn't matter as long as they're the same.

  • Do you mean why? It's just packing the four booleans into one number using one bit per boolean. I could have just as well packed each boolean to each decimal place like this:

    roominfo.exitE+10*roominfo.exitS+100*roominfo.exitW+1000*roominfo.exitN

    The idea was to use one variable comparison instead of four. Look in "Event sheet 1" events 5-11 for it's use.

  • The layer texture only exists when the runtime is drawing and the layer has "force own texture", otherwise I'm pretty sure drawing is done on the main canvas.

    If you just want to know the contents of a pixel in an image you can try the rgbaAt expession of the canvas plugin.

  • Hard to say if the idea is implemented right from a picture but it looks somewhat on par. You can extend the idea future by perhaps instead of looping through half of the array at a time, loop through a fourth or tenth.

    Another idea is to not call updatetile every time. I don't know what it's doing exactly but it probably is a main fps eater if it creates new tiles or does something with all the tiles.

  • gonzdevour

    The error is from pasting the canvas onto itself which now isn't allowed. Initially this was permitted by the runtime but it's an edge case that doesn't work on all exports so a more recent release prevents it from happening and throws the error.