R0J0hound's Recent Forum Activity

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

  • 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

  • lennaert

    There's an example of finding if an object is inside a polygon here:

    Events 7-9 are the relevant ones to pick the inside objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • —

    Mobile devices are not a goal, but there's no reason why it shouldn't work there. My target is first getting all the features working well first with a good design for the events. If i encounter any major problems I'll try to adress them as they come up, and every export platform should benefit from it.