R0J0hound's Forum Posts

  • Updated #9:

    Removed beta from name since it's pretty much feature complete.

    Edit:

    Arima linkman2004 or Kyatric

    Could this topic be moved to completed addons?

    Also a collision layers test:

  • Are you sure your posts weren't just moved here?

  • Here's a test that plays a sound when object's collide. The volume varies by how much Kinetic energy is in the hit. You can fiddle with the equation that maps to volume to adjust it. In a similar way I added puffs of dust that spawn at the contacts.

  • It works on any length lines. It just relies on the lines being created in order. Also don't have any other lines off screen. I think I swapped some variable names so it's confusing. You can eliminate the need for variables if you add a imagepoint to the right-center of the line object and do this:

    For each Sprite
    For each line
        | compare: line.y>sprite.y != line.ImagePointY(1)>sprite.y
        | sprite: x < (line.ImagePointX(1)-line.x) * (sprite.y-line.y) / (line.ImagePointY(1)-line.y) + line.x
        -----
            + Sprite: set animation frame to 1-Sprite.AnimationFrame[/code:30x5v5gm]
  • Somebody

    Well you can capture to a lower resolution image with this:

    You could change the scroll and zoom so what you want to capture covers the screen, and then you can capture a lower res image.

    Or it can be modified to capture an area of a certain size.

    Edit: It wasn't always working with webgl on. The trick is you need the canvas to redraw for it to work. So to get it to redraw you need something moving, and at least one object spinning would do that trick.

  • Prominent

    It acts crazy because the joints are pulling the blocks into contact which in turn try to push out of each other. Floating point numbers introduce a tiny bit of error so sometimes the objects won't be in contact but will overlap a little, which causes the fighting. Offsetting the points or polygon is a good solution. I don't think there's anything I can do in the behavior code, it's just how the physics works.

  • You can do it with a z variable that you can think of as the distance into the screen. Then you just change the object's size based on how far into the screen it is to make it seem farther away. Something like set scale to 100/z would work but you can tweak the number. If you want farther away objects to be behind closer ones you could do that with a for each ordered condition.

    Here's a capx I did a while ago that utilizes that effect.

  • Update #8

    +Added world2local and local2world expressions to convert coordinates.

    +Fixed a few typos in the ACEs

    Prominent

    Here's another tweak of your capx using the new conversion expressions. There still is some joint fighting when there is more than 1 joint between two objects that can cause the objects to move on their own.

  • I think a pivot joint would work better than a pin. You can try the "add pivot joint at xy" action with parameters:

    Family2.uid

    Family1.ImagePointX(loopindex("points"))

    Family1.ImagePointY(loopindex("points"))

    Every other joint uses relative locations but that one uses a layout location. I think I'll add a "layout2relative" expression so we can use layout locations for the other joints if needed.

    Also according to the chipmunk forums a good way to join objects together is with two joints, a pivot and a gear joint (with a 1.0 ratio). I modified your capx to do that, also for the gear joint it needs a phase of Family2.Angle-Family1.Angle to keep the angle difference of the objects.

  • Prominent

    The relative positions for the joints is relative as if the object was unrotated. so if the object's angle was 90 degrees a relative offset of rect(10, 0) would be (sprite.x, sprite.y+90). But also keep in mind as the sprite rotates the point will adjust. I wonder if I should make the offset relative to the sprite's current angle. It might be a bit more intuitive.

  • animator

    If you mean the android game I agree with Kyatic that you could get the look with q3d. The issue is the 3d physics would have to be done manually since there isn't a plugin for 3d physics yet.

  • 1. Use the "snapshot canvas" action

    2 under a "On canvas snapshot" condition use:

    3 sprite->"load image from url" action with the CanvasSnapshot expression.

  • [quote:10f9gv3j]Why we can't locally load files in Preview Mode in Node-Webkit ??

    We can though. In node-webkit preview if you use "document.xml" as the file it will look here:

    "http://localhost:50000/document.xml"

    If you want to get the file from the same folder as the capx you need to type it in explicitly:

    "C:\Users\rojo\Documents\c2projects\document.xml"

    And to make it work in preview or in export you could use a global like this:

    global text AppPath = "C:\Users\rojo\Documents\c2projects\"

    Start of layout

    System: [NEGATE] is in preview

    --- set AppPath to NodeWebkit.AppFolder

    And then request any files with:

    AppPath & "document.xml"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks. That capx mesmerizes me too, since I don't understand all of the equations I used in it. I'd have look up the reference again . Basically it counts how many times a line starting from the point toward the right cross an edge of the polygon. If it's an odd number of times, it's inside, otherwise it's not.

  • Update #7

    +Added segment shape

    note: no segment/segment collisions possible. This is a limitation of Chipmunk 6.1.1

    note2: "segment shape radius" can be positive or negative. If it's positive rounded endcaps are added to either side. If it's negative the endcaps do not extend pass the width of the object.

    +Added segment shape radius property.

    +Added more expressions:

    segmentRadius, area,

    comx, comy (center of mass)

    +Added descriptions for all the ACEs and change the names of the query conditions to make more sense.

    +Bugfixes for:

    • polor vectors were treating angles like radians. They needed to be converted in the behavior.

      Prominent

    negative or zero sized objects

    a few things with changing the mass and making immovable.

    some other things I forgot to write down.

    -cheers everyone