R0J0hound's Forum Posts

  • It's likely a graphics driver bug, try updating your graphics card driver.

  • For the other example you'd have to tweak it to use the 8dir movement instead of what it uses now.

    With just horizontal and vertical walls you could use the overlaps at offset condition to see if there's a wall next to it and just invert the X or y vector depending on which side a wall is. You could do it like the following. The first step would be to get the Sprite out of the wall, that is where custom movement is useful. On another note you could also compare the X and y velocity in addition to the wall detection, since you only need to bounce against walls you're moving toward.

    Sprite overlaps wall

    Sprite: customMovement: push out of solid

    Sprite: overlaps wall at offset (-1,0)

    Or

    Sprite: overlaps wall at offset (1,0)

    Sprite: set xvelocity to -self.xvelocity

    Sprite: overlaps wall at offset (0,-1)

    Or

    Sprite: overlaps wall at offset (0,1)

    Sprite: set yvelocity to -self.yvelocity

  • Try Construct 3

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

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

    You could also use the bullet behavior to handle the bounce:

    https://dl.dropboxusercontent.com/u/542 ... _8dir.capx

    For more precise bouncing you'll need to find the angle of the object hit.

    Maybe something like this:

    viewtopic.php?f=147&t=152906&p=964827&hilit=normal#p964827

  • The joints just need to be created a tick after the objects are created. You could save the tickcount to a global variable when you create the objects and compare when the tickcount equals that global plus one to add the joints.

  • Yeah the compare all will do that. It's probably a bit flawed now that I think about it since it's comparing per component instead of per pixel.

    So a transparent pixel rgba(0,0,0,0) will be 75% similar to a black pixel rgba(0,0,0,255) instead of not at all.

    Fix that and a blank image should give a lower percentage.

    "rms" is a term used in your last link. It's basically the distance between the two pictures.

  • socialpilgrim

    As rex said you could use the asjson expression to load the image into a array for faster comparison than using rgbAt().

    Here's an example with three examples:

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

    /examples30/imageCompare.capx

    Since it's for a drawing competition I find that just comparing the alpha gives a more meaningful percentage. Just checking all the pixels like with your links gives a 90% similarity to a blank canvas.

    Anyways I implemented three methods in the capx.

    The first follows the examples in your links and gives a percentage and rms number. I guess rms could be used as a way to compare.

    The second only looks at the colored areas of both images and gives a pretty good measurement.

    The last one finds the bounds of both drawings and compares both as if they were the same size. This allows a small box to match a big one.

  • neverk

    There's a fix for that here:

    I haven't put the fix in the plugin link yet.

  • JoaoCesar

    If you want to distort the paster's texture itself you'll need a second paster object to draw to.

  • I've found a spring works better than a pivot joint in situations where you want to drag the object around. I think I had a example in the first few pages of the plugin.

    Other things you could try:

    *set a max force for the joint. By default a force up to infinity can be exerted on the objects to make the joints match. By setting it lower it would make the joint more relaxed and keep it from pulling into another object.

    *increase the iterations of the simulation. This is a performance trade off. The higher the iterations the simulation will get closer to converging on a perfect solution. Personally I never mess with it, instead I do other things like above.

  • Best I know those are local points relative to the top left of the unrotated and unscaled object. It could be center too, you'd just have to test it. Worst case it would be relative to the hotspot.

    Just a thought, I haven't looked at your code but it might be enough to just call update_bbox() after changing the hotspot.

  • For doing it in event 2 of your pic...

    the object would be numwagon2

    The first expression would be: numwagon2.animationframe=numwagon.animationframe|numwagon2.animationframe=numwagon3.animationframe

    The comparison would be "="

    and the second expression would be 1

  • You could use a system->"pick by comparison"

    with an expression like:

    numwagon.animationframe=numwagon2.animationframe | numwagon.animationframe=numwagon3.animationframe[/code:3klcw15a]
  • You can also draw a distorted texture with the paster plugin:

    I've used it for 3d here:

  • You may try looking in this plugin here:

    In it there's an action to move the origin around and the collision polygon is updated. Maybe that could be a reference.

  • Saitama

    For me the error is "Cannot read property 'c2obj' of undefined".

    Looking at your event, when you create the joint you set "Object2 UID" to 2.

    The wire does have a uid of 2 but it doesn't have the chipmunk behavior. You can only create joints between objects with the chipmunk behavior.

    In my example I used -1 for "object2 uid". That means just connect to a fixed location on the layout. The wire in my example didn't have the physics behavior either, it was just for a visual.