R0J0hound's Forum Posts

  • 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.

  • I was under the impression that the timeouts occur for almost everyone, myself included. There are a good number of topics with regard to the issue, which in my experience has been a problem since the forum software was changed at C2's launch. I haven't seen any fixes that have helped on my end so that leads me to think that the issue doesn't show itself at Scirra's offices.

    The workaround that many users currently use is to copy their text before attempting to post reply.

  • guess that sconstruct 2 will never be able to produce a game such as stealth ********

    Well, just because you haven't found a way to do it yet doesn't mean it can't be done. From what's on these forums there are ways to draw the shadows. There just isn't an example made yet to test if an object is in shadow. As a simple idea the line of sight behavior could be used from the lights to the player and if there isn't a LOS then the player must be in shadow. There are probably other ways though.

  • You're thinking of "bitwise and". "&" in C2 expressions is "logical and" where 0 is false and nonzero is true.

    That said you can do "bitwise and" with the browser object and the ExecJS expression.

    For example setting some text to Browser.ExecJS("4&2") will give 0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The only other idea that comes to mind is to use the function object and make functions to set/get variables.

  • Instead of using the variable name you can try using the variable's index. 0 for the first, 1 for the second, and so on.

  • I don't have any documentation, this topic is a good place to get info on how to use it though. The plugin's actions are fairly self explanatory and there are examples in this topic that show it's use in various situations.