R0J0hound's Forum Posts

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

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

  • You do not have permission to view this post

  • Prominent

    [quote:3dpc5daj]edit2: been trying to use it, but adding forces to objects seems to mess things up. their points seem to become displaced and move all over inaccurate from the object.. weird... :\

    Can you provide a capx that does this, I can't reproduce it. It's working here for me.

  • The tilemap object is causing this. It only draws what is onscreen and as I recall the paster objects don't change where the screen is at for the pasting.

    I wonder if scrolling to player2, pasting, and then scrolling back to player1 would work as a solution.

  • Prominent

    For the line collision type I'm thinking I'll have the start of the line will be the left-center of the object and the end will be the right-center. That will also take care of the visualization since Behaviors can't draw anything.

    It should be just as possible as using box2d. That being said I don't know how this compares to box2d in performance on mobile devices.

  • Try Construct 3

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

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

    I made this one recently, but corner bouncing can be a bit odd.

    The idea was to try to move horizontally then vertically. So first move the ball horizontally and if it then is overlapping a wall move out of the wall and invert the x velocity. To simplify moving out of the wall I just moved the ball back to it's x position before it moved, which looks good enough. The same is then done in the vertical direction.

    Overall it works great for horizontal and vertical walls, but as I said corner bouncing still can look odd. For more accurate corner bouncing we need to find what the ball hit first, a corner or an edge.

    Attached is another capx example. To make the bounces even more accurate we just need to improve the normal detecting events. The only complicated looking math is in event 11 when speed_along_normal is set. It's doing a vector dot product which gives us the speed in a certain direction. One thing you can do is check if the ball is touching a corner by seeing if the distance between the ball and a corner is near the radius, then in that case the normal would be the angle from the corner to the ball.

    Anyways just some ideas.

  • The problem is an interface in the editor to define lines with a start and end point isn't really possible in c2's editor. We're limited to how sprites and other objects can be placed and manipulated. Another issue is behaviors can't draw anything in the editor as I recall. A way to do it from events could be done but it's not quite as user friendly.

  • The path editor part is not possible to do in C2's editor, so a c2 version of this is not likely.

  • Prominent

    Tilemaps aren't properly supported yet. There is some special handling for tilemaps in the built in physics behavior, but there's a few other internal things I want to tweak before implementing it. As of right now it should work with at least sprites and tiledbg.

    I'd like to add lines but I need to think of an intuitive way to do it. I'm leaning toward just another collision shape type, along with a radius (which can also be applied to polygon and box btw). If you mean something else or have any ideas of using lines that wouldn't be handled by my idea, let me know.

    Thanks for the report on using forces, it was working but I may have broken something with an update. I'll be sure to take a look after the holidays.

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

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