R0J0hound's Recent Forum Activity

  • For that type of isometric you can still use "for each ordered" depending on what features you want to have. Using for each gives absolute sorting whereas comparing one object to another is relative sorting, which can prove to be more complicated.

    Here is an example with the simplification of everything being on a ground level. I put the hotspot on the bottom-right-front corner of the box. You should have consistency for where the hotspot is placed otherwise it can become very complicated indeed. Next do some measurements on your box, particularly just measure the top face of the box. I measured it as 308x108. Put the player and box in a family and now we can make the "for each ordered expression".

    For that I used the formula of a line:

    y-y0 = m *(x-x0)

    The idea I came up with is from that formula is as follows.

    <img src="https://dl.dropboxusercontent.com/u/5426011/examples20/iso_idea.png" border="0">

    Looking at a screenshot I drew a bold red line on each box from the bottom-left-back corner to the bottom-right-front corner. Notice they are all parallel. Next I extended lines to the left and I also made a line from the player using the same slope as the other lines. The y order of where the lines hit the left is the same order they can be sorted. So all that's left is to calculate where the lines will hit.

    First we rework the formula to solve for y0 when x0 is 0. This is where the line meets the left.

    y0=y-m*x

    Then we can calculate m (or the slope) from the measurements. The definition of slope is rise/run or (change in y)/(change in x).

    So...

    m=108/308

    and our formula is now:

    y0=y-(108/308)*x

    Finally make an event as follows:

    For each Family1 ordered by Family1.Y-(108/308)*Family1.x ascendeing

    --- Family1 move to top

    Example capx:

    https://dl.dropboxusercontent.com/u/5426011/examples20/iso_test.capx

  • You could look at the plugins Polygon or Canvas to do what you're asking.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With it off the canvas isn't cleared so you'll have no transparency. First an foremost get something working and then you can look for shortcuts and speedups.

  • You could use the canvas plugin like tulamide said, but yes it would be pretty slow as looping over all the pixels of an image in general is a slow thing to do without a gpu shader.

    You can take a snapshot with a transparent background. You just need to set the bottom layer to be transparent.

    Here's my test: https://dl.dropboxusercontent.com/u/5426011/examples20/snapshot_transparent.capx

  • To make a function to call later use a "start of layout" with the "execute javascript" action in the browser object. You will have to rewrite the first line of your function like this so you can call it later:

    this.getHashFromUrl = function()

    Then you can call it later with another "execute javascript" action like this:

    this.getHashFromUrl()

    Be warned that it may not work with a minified export. Also in general it is probably preferred to just make a plugin.

  • PM me the cap file I'll see if I can repair it. I made a python library called capreader that reads cap files and it can be used to debug them.

  • It could be useful though if the array rounded instead of floored values to integers. Although that may lead to other math issues in other situations...

  • Hi, I got it working so that the eggs stay a certain time delay behind the player.

    https://dl.dropboxusercontent.com/u/5426011/examples20/yoshi_eggs_time.capx

    I changed a few things to get it to work. First in addition to x and y I also save the time. This is so I can find the saved position just before and after a certain time. If the first egg would is half a second behind the player then I would find the positions closest to time-0.5. After that I can then interpolate between the positions with lerp. The send thing I change from the original is add to the front of the array instead of the back so I could trim off the excess with a set size.

  • You could just use a canvas that's only 1 pixel high, paste to that and then stretch it to the bottom of the screen.

    Ex.

    https://dl.dropboxusercontent.com/u/5426011/examples20/laser_blit_canvas.capx

    https://dl.dropboxusercontent.com/u/5426011/examples20/laser_blit_paster.capx

    The events look pretty much identical from canvas to paster.

  • Now that I'm wide awake and not on my phone I did some tests. I'm pretty sure you'd have to use round() in CC as well. And as far as being just integer values cos(270) is not exactly 0 in either C2 or CC.

    If you set some text to cos(270) you'll get 0, but that's because C2 does some rounding to give you prettier numbers for display. If you set the text to str(cos(270)) you'll bypass the pretty rounding and get -1.8369701987210297e-16.

  • Probably the rounding issue is due to how the expression is converted to an integer. Which likely is the equivalent to int(expression).

    newt

    Couldn't you also just use round(mouse.x/cell)*cell