R0J0hound's Forum Posts

  • Leaufai

    One way to do the front shock is with a groove joint and a spring.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With the physics behavior the only way is to use a family. So if your objects are "sprite" you need to add that to a family then in events pick one object with "sprite" and the other with "family".

  • One idea is to use a canvas. 1st paste the character and then paste with "destination-out" anything in front of the player. Then loop over all the pixels of the canvas and see if any pixels aren't transparent. The main issue with that is it's very slow.

    If you can treat the player as a square it can be done much quicker.

    For instance to check if a player's bounding box is inside another box you can do this:

    box.bbleft<=sprite.bbleft

    box.bbright>=sprite.bbright

    box.bbtop<=sprite.bbtop

    box.bbbottom>=sprite.bbbottom

    It would become much more complicated if you wanted to know if multiple boxes covered the sprite completely. It would probably require splitting the bboxes up.

    Another idea would be to loop over the positions of the sprite and 1st check if the point overlaps the sprite then see of it's overlapping the object's above the sprite. It could be slow too but you also could do a more coarse check by not checking every point.

  • You do not have permission to view this post

  • I think you just need the common and sdk folders and everything in them. Visual studio is then needed to compile the templates in the sdk folder. Open the *.sln files with visual studio. I've used visual studio 2008 successfully, but I don't know if newer ones will work.

    Once the project is open there is a dropdown to select between:

    Release, runtime, debug release, and debug runtime.

    Release is the edittime portion of the plugin and runtime is the one added to cc games.

    I don't recall off hand where the built ctx files are put but you can find out where by poking around the settings. You can also set it to build directly in the plugins folder of construct. Just be sure to change the filename used.

    You probably will want to download the other folders as well to get the source for other plugins since most of the info you'll need about the sdk will be learned by example.

    Also in order to build any plugin that uses graphics or sound such as caudio2 you'll also need the directx sdk.

    In short it can be done, but if you've never used visual studio or c++ before it will be a rough start.

    What do you plan on doing? Python is probably much easier to work with.

  • Anything that can be done in js, can be done with the Sdk. It may be tricky to get it to hook in to the audio plugin if you want a seperate plugin. Another option is just to modify the audio plugin, but any bugs introduced won't be supported officially.

  • It would be the same as for instance a "start of layout" condition. Any way you set it up is fine. no extra calculations are done and c2 just triggers them top down.

  • striimix

    Those functions are related to the chipmunk.js library's spacial partitioning scheme. It's nested because it's a tree structure and it would make sense that it would be called a lot as it would update as objects move. In my tests it's only taking about 5% of the total time and it's size is remaining constant (251 leaves for 251 objects), so that's not the culprit.

  • Attached is a exact way to do a rounded path like the op.

        * |*  *  *  *  *  *| *
     *    |                |    *
    *     |       o        |     *
    *     |                |     *
     *    |                |    *
        * |*  *  *  *  *  *| *
    
    |     |\               |
    +-----+ +--------------+
     radius       space[/code:15y1qd5m]
    
    You can think of each piece of the path like a lerp from one point to another.
    left side:
    x = center.x - space/2 + radius*cos(90+180*t)
    y = center.y + radius*sin(90+180*t)
    
    top:
    x = center.x + 0.5*space*lerp(-1,1, t)
    y = center.y - radius
    
    right side:
    x = center.x + space/2 + radius*cos(-90+180*t)
    y = center.y + radius*sin(-90+180*t)
    
    bottom:
    x = center.x + 0.5*space*lerp(1,-1, t)
    y = center.y + radius
    
    where t is a number from 0 to 1.
    
    Now all that needs to be done is depending on the distance traveled choose the correct equations and t value.
    We first start with the distance traveled:
    distance = speed * time
    
    Next we need to know the lengths of the pieces.
    The top and bottom are easy with a length of "space".
    The left and right can be found with the following equation:
    arc length = radius * (angle in radians)
    Which ends up as pi*radius for each.
    
    With the above the total length = 2*pi*radius+2*space
    
    To choose the correct equations we compare the distance traveled,
    
    0 to pi*radius is the left side.
    pi*radius to pi*radius+space is the top.
    pi*radius+space to 2*pi*radius+space is the right.
    2*pi*radius+space to 2*pi*radius+2*space is the bottom.
    
    Then we find a t (0..1) value for the side with:
    If left then t = distance/pi*radius
    If top then t = (distance-pi*radius)/space
    If right then t = (distance-pi*radius+space)/(pi*radius)
    If bottom then t = (distance-2*pi*radius+space)/space
    
    As a final step we want it to loop so we can use the % operator with the total length to do that.
    distance = (speed*time)%(2*pi*radius+2*space)
    
    If speed is negative then we need to do effectively this:
    ((a%b)+b)%b
    
    In the capx I used a function for that.
  • Ruskul

    From what I've found the js profiler indicates that hundreds of tiny js objects are accumulating over time. For some reason those object's aren't able to be gc'd, presumably because there's some reference to them still somehow. All I can get out of the profiler so far is the type of these objects (mainly array and code objects), but I haven't had any luck figuring out what they are exactly or where they came from. Also the slowdown is presumably due to the added load of the garbage collector to sort though those objects.

  • Dropbox is very stable. There's nothing you can do if the person who posts a link to a file removes it later. Any other file host could be used and there would be the same problem. I use dropbox for most of my uploaded capx files and I have no plans to transition to something else, since all the files all are still there.

    Also the capx upload feature of the forum wasn't always there, which explains why many older posts didn't utilize it.

  • The library to use depends on what file format you want to play. Taking that adpug link I posted and tweaking the js it uses a bit results in the attached capx. It uses the same method as my mod player capx'. All it does is play any file you specify. Any other features would require delving deep into the source to: A find if such a feature is possible and B. figuring out how to use it.

  • Very cool. Making a loader for a file format is always something fun to do.

  • Here's a general tutorial about that sort of thing:

    http://69.24.73.172/scirra/forum/viewto ... lit=3D+box

  • The next step would be to make a plugin that runs the js code necessary to start playing sound. The js libraries usually have a working example that you'd mostly copy.