R0J0hound's Recent Forum Activity

  • Hi,

    This will be a dump of various tests and examples that I haven't posted elsewhere. Enjoy.

    https://www.dropbox.com/s/29oqa2k7o1c6x ... .capx?dl=0

    A test to keep multiple moving sprites from overlapping each other or overlapping the walls. The wall collision resolution is done with the seperating axis theorem (SAT) which has the benefit of allowing the sprites to smoothly slide accross the walls. The motion is done with verlet intergration which when used with a way to push out of obsticles provides for decent boncing.

    https://www.dropbox.com/s/hdp7sujyqd5rm ... .capx?dl=0

    A non-interactive 2d skier simulation. The slope is a randomly generated continuous curve of beizers. The skier has some manually evented physics so he smoothly goes down the slope and gets air on some hills. As a side note the only behaviour used is "scroll to".

  • Instead of using "sprites is overlapping sprites" create another family of the same objects, then you can use "sprites is overlapping sprites2" and you can clearly pick one or the other.

  • Erasing is done by pasting an object with the "destination out" blend. To erase an abitrary shape you'll have to draw to another canvas give it the "destination" out blend and paste that to the original canvas.

    stachir

    My Paster plugin allows you to draw a texture to an arbitrary quad, but it currently uses the whole texture instead of a sub-texture. But it appears doable with that.

    TwinTails

    With this plugin you can draw whatever you want, so you have the visual aspect. The collisions isn't aren't really possible with this as it's collision polygon is always just a rotated rectangle so it's not good for collisions. There are capx' around that show ways to do per pixel collisions but it's you'll need to put actual sprites over it so it can be somewhat tricky. You could try yann's Polygon plugin as it handles the drawing and collision polygons.

  • You're welcome. On further thought "this" is the only thing that's not minified so it should work with a minified export. You only run into trouble if you try accessing thing that will be minified such as "this.runtime".

  • Ok. In the past I've seen the bug where adding another object removes another and I was able to make a utility to fix it although I'm not sure of the original cause. My hunch is it may be related to copy/pasting between caps in some situations.

    Anyway here's the utility I made to fix the issue:

    http://www.scirra.com/forum/utility-python-cap-reader_topic42039_post260632.html#260632

    On the technical side the cap file keeps track of what id will be used next for object types, object instances, effects, behaviors, and family effects and behaviors. The issue arises when this value is the same as an existing id so when something new is added two things will have the same id and undefined things happen. All the utility does is check all things that have an id and find the highest value, adds one to that and writes it back to a copy of the cap.

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could look at the plugins Polygon or Canvas to do what you're asking.

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