R0J0hound's Recent Forum Activity

  • Update #6

    * Fixed the crash on nodeWebkit tumira SgtConti

    * Reworked it so changing the size/animation will change to collision shape automatically. As a result I removed the "Update collision shape" action which is no longer needed.

    * Fixed "pick nearest segment query"/"pick nearest point query" so it would work right when multiple object types are used.

    -Merry Christmas

  • Colludium

    That's pretty cool it performs that good. It's better than I expected.

    A bit of an update with supporting things in the list.

    1. This is kind of doable now. You can cancel the acceleration from gravity by applying force -mass*gravity in the "pre step" trigger

    5. You can get collision info now with the "on post collide" trigger.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • update #5

    * added preStep trigger. With it you can effectively stop any acceleration due to gravity by applying a force in the opposite direction.

    * added "on Post collide" trigger. With it you can get extra info about a physics collision such as:

    • contact points, normal, depth, impact, total energy and uid of other object.

    tumira

    Ah cool, that's the same bug that SgtConti was getting and I can reproduce it with NodeWebkit. I'll try to debug it tomorrow. Firefox and chrome are working fine though.

  • If you're interested in another physics behavior I've been working on one based on chipmunk2d here:

    It already has more features than the bundled physics behavior, although I'm unsure how it compares performance wise. It's beta but I've fixed every bug I've found so far, however it just needs more testing.

    Comparing it to your list it gets about half of them right now.

    1a It currently has collision groups and layers

    1 not currently, but it's a simple change to get it working.

    2 It has every joint chipmunk2d has to offer.

    3 Not currently. I can add segments with a radius as another collision shape so you can just use objects. Other than that I'm not sure of a good workflow, but I'm open to ideas.

    4a not directly but a pivot and gear joint together should work. It is possible to give bodies multiple shapes in chipmunk.js but I haven't come up with a good workflow, so only one shape is used.

    4 It can do ray tracing with line segment queries currently.

    5 Not yet. I'll add it to my todo.

  • Update #4

    * Forgot a few expressions: forceX, forceY, inertia, angVel

    * Added Actions/expressions for angular and linear speed limits.

    * Added tagging to the constraints, so now you can reference them later either by the tag or an index.

    • along with that you can set the set the max force of a constraint.
    • also you can destroy individual joints

    * Added a pointQuery and segmentQuery conditions along with appropriate expressions. Can be used to find the closest shape to a point or for raycasting.

    I think that's about it, I probably forgot a few things.

    Current todo:

    * Polish ACE table

  • Update #3

    * Added expressions for everything and more actions to set object properties including:

    -elasticity, friction, collision shape, mass, collision groups and collision layers.

    *Added simulation settings:

    • stepping mode: fixed or variable

    -set fixed mode timestep

    • set iterations

    -set damping

    * Added enabling/disabling and the ability to set immovable or not.

    Right now if you change the object size or animation you have to manually tell the shape to update with the "update collision shape" action. I'm not sure if I'll change that... If I make it automatic you'd have a performance hit with animated objects.

    Other than that all the functions seem to be working without errors. Feel free to try it out and let me know if you encounter any bugs. The main thing left to do now is polish up the ACE names and descriptions.

    SgtConti I've re-tweaked a lot internally so I'm not sure if that bug was squashed.

  • indiegrimes

    event 1:

    every time the number of pixel objects is 0, have the two images swap layers and...

    event 2:

    Do a loop to cover the objects with pixel sprites. They are sent to back so the overall order looks like this:

          +--- s1 sprite: blend: source in
          |
          +--- pixel sprites
       ___|______
      /   |     /
     / layer 1 /--- force own texture: yes
    /_________/
          |
          +--- s2 sprite: blend: normal
       ___|______
      /   |     /
     / layer 0 /
    /_________/[/code:18u4e1c5]
    
    Events 3 and 4
    set the blend mode for the image sprites depending on what layer they're on.
    
    event 5
    Destroys the pixels one at a time.  The repeat is so it goes faster than 1 pixel per frame.  The equations should simply be SPEED*60*dt where SPEED is in pixels per second.
  • VictoryX

    I made a capx with a lot of different approaches here:

  • The equation is correct. Using impulse to launch the projectile is where the variance is.

    Impulse = Force*time

    and from best I can tell dt is used for time and that varies.

    Try setting the velocity instead with:

    velocityX=speed*cos(angle)

    velocityY=speed*sin(angle)

  • R192 is also free, it's just a beta version. You can find a link at the bottom of the page.

  • Here's a capx. I used "pick top instance" to pick only the last box created

  • Why not use the polygon object? It makes it very easy to draw a polygon. For example:

    on mouse left click
    --- polygon: clear polygon
    
    left mouse button is down
    --- polygon: add vertex at (Mouse.x, Mouse.y) -world-space
    
    on left mouse button released
    --- polygon: draw polygon ...
    [/code:2x63fnpc]
    It doesn't play well with the physics behavior but at least the collision polygon will match the drawn polygon.
    
    You could also draw the polygon using the canvas plugin but it has no collision polygon.
    
    So drawing it isn't what's hard.
    
    For just a box no third party plugin is needed.  Only the mouse and a sprite with the origin centered.
    [code:2x63fnpc]global number startx=0
    global number starty=0
    
    on left mouse click
    --- set startx to mouse.x
    --- set starty to mouse.y
    --- create Sprite at 0,0
    
    left mouse button is down
    -or-
    on left mouse released
    --- Sprite: set position to ((startx+mouse.x)/2, (starty+mouse.y)/2)
    --- Sprite: set size to (abs(startx-mouse.x), abs(starty-mouse.y))
    [/code:2x63fnpc]
    If you want it to fall afterwards you could use the physics behavior, only be sure to disable it until the mouse button is released.
    
    If you want a box then no plugin is needed