R0J0hound's Recent Forum Activity

  • Updated to version 1.5

    Download in first post.

    * Change: Renamed the conditions in the "Query" group to with more intuitive titles.

    * Fixed: query conditions now work with families.

    * Fixed: some of the query conditions were not working with concave polygons or tilemap.

    mattb

    That's a cool example. Also thanks for the family bug report.

    Prominent

    It's now fixed.

  • mattb

    Here's an example of the line segment casting. The query conditions also set it's query expressions which can give normal and hitpoint.

    "pick overlapping line segment"

    Picks all object's whose shape overlap the line. In addition to picking the objects, info about where the line hit, and normal are accessible from expressions which all start with "query".

    "raycast and pick first hit"

    It's about the same as the one above, but it only picks the first object hit. It also gives the ability to filter out objects by collision layers or group. It sets the query expressions as well.

    Note

    :

    "pick overlapping line segment" isn't working all the way with concave polys or tilemaps, but the other condition is working fine.

  • Updated to version 1.4:

    Link on first post.

    * Added the new icon. Credits to —

    * Added: Polygons can now be concave. Internally they are converted to convex polygons.

    * Added: Tilemap objects now work. See note[1]

    * Fixed javascript error with "line segment query" condition.

    * Fixed bug with queryNormY expression. Was the same as queryNormX.

    * Change: The default sleepTimeThreshold is now 1 second. It was 0.5 before, and objects fell asleep to quick.

    * Joints updates:

    • Added the ability to use a postion on the layout or an imagepoint to determin where to connect to objects.
    • Added: Now you can attach joints to the layout by using -1 for the uid of the second object.

    [1] Tilemap notes:

    Tilemaps ignore the "collision shape" and "prevent rotation" will always be considered "yes".

    The area expression for tilemaps will return 0.

    Changes to the tilemap are not detected currently, so the collision won't change if the tilemap is changed. A workaroud is you can force an update by changing the size of the object.

    Prominent

    The collisions won't automatically be updated if the tilemap is changed. You can manually force an update by changing the tilemap's width.

    -cheers

  • mattb

    The "pick overlapping line segment" should do it, but it seems to be bugged in the last version I uploaded. The fix will have to wait till I finish with the other stuff I'm adding, which is requiring lots of code changes.

    Stuff like this:

    https://dl.dropboxusercontent.com/u/542 ... index.html

  • Update:

    I touched up the "copy from canvas" action so the texture should never be flipped. It's not completely polished but it should be useable.

    Note:

    For me on chrome it grabs the image from 4 frames ago. I don't know if that can be changed.

    Also as for now the bug where the opacity of a pasted object is ignored if the object has an effect, is still not fixed.

  • Nitro187

    You're right there is no angular damping at all so the object would accelerate indefinitely. It can be useful though so I may eventually make damping built in.

    The way to disable collisions between object's is to use collision groups and layers. They aren't colliding because they both are in the same collision group.

    Actually box2d doesn't work with concave objects either, both libraries need the concave polygons to be converted to multiple convex ones. The built-in physics behavior does this automatically for you, but this behavior doesn't yet.

    mattb

    -1 has a useful meaning for uids that means no object. Instead would being able to type "world" be better? It would make it more clear what was intended.

  • neverk

    You can do it with a loop by pasting a line at a time. It's fast enough to make the image but not necessarily enough to do every frame.

  • Nitro187

    "Set torque" does what it says, it set's the torque. The only difference to apply torque is possibly adding to the torque, but you can do this with "Sprite.chipmunk.torque + something".

    Here's it working with chipmunk

  • Android-Music

    The capx in this post may help.

    Otherwise here's the math to scale any object around a point (centerx, centery). Just do it for all the objects you want to scale around that point.

    set x to (self.x-centerx)*scale + centerx

    set y to (self.y-centery)*scale + centery

    Set width to self.width*scale

    Set height to self.height*scale

  • Try Construct 3

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

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

    Here's an updated capx with more of C2's niceties.

    /examples26/astar_nodes.capx

    https://www.dropbox.com/s/p1w0y1qusjp38 ... .capx?dl=1

  • Updated to version 1.3

    * Fix: removed an alert left in the set mass action.

    * Fix: speed expression was broken.

    mattb

    I'll have to give this more thought to keep things simple. Ideally we could coose from:

    layout x,y

    imagepoint

    relative to orientation of the object *(what's currently done)

    boybacteria

    Thanks for the icon. It makes it look like a physics behavior as much as the name does.

    edit: opps, forgot to add it. will next update for sure.

    spongehammer

    That's a typo on my part. I used ^ which in js means xor instead of squared.

    Prominent

    The built in physics' mass property is more like density, since the box2d mass is calculated with the area of the shape.

    You can do the same in this behavior by setting the mass to with the area expression.

    mattb

    Here's a capx that sets the mass based on object size.

  • Somebody

    "is in crop" may be something that needs to be handled differently. If I ever get it to work right I may check what the scaling mode is an do something different for each.

    Also I need to revisit that transparency bug, but the current , albeit poor workaround is to paste the paster to another paster and set the transparency of that. As I recall that's what I may end up doing internally.

    TiAm Somebody

    I'm not having much progress with getting the canvas pasting to work reliably. It's currently kind of random if it works or not, so I may end up having to go a slower route of making an off screen texture and rendering everything to that.

    neverk

    Perspective transforms aren't possible with the "draw textured quad" action. For that the points would need a z coordinate, but that's not part of C2's renderer. For perspective transforms a shader should be used. The closest we have is the mode7 shader but a better on could probably be made.