R0J0hound's Recent Forum Activity

  • The layout already has a number as I recall. Isn’t there an expression for it?

    Otherwise you could a sprite with one instance per layout and use an instance variable and set it to a different number per layout.

  • angryscientist

    I won't be able to add that since i'm not working on this anymore.

    delgado

    I don't use parallax, but it is something you can do via events. Basically just move the object from one layer to the other, paste, and then move it back. Something like this:

    global number oldLayer=0

    global number oldX=0

    global number oldY=0

    global number x=0

    global number y=0

    set oldX to sprite.x

    set oldY to sprite.y

    set oldLayer to sprite.layer

    set x to LayerToCanvasX(sprite.layer, sprite.x, sprite.y)

    set y to LayerToCanvasY(sprite.layer, sprite.x, sprite.y)

    Sprite: move to layer canvas.layer

    Sprite: set position to CanvasToLayerX(canvas.layer, x, y), CanvasToLayerY(canvas.layer, x, y)

    canvas: paste sprite

    Sprite: move to layer oldLayer

    Sprite: set position to oldX, oldY

  • Same issue as dop2000. The forum is dog slow now. I get the idea that websites aren't Scirra's expertise.

  • It's the fx:

    It's used apart from the canvas plugin.

    The only useful action in the canvas plugin would be the "paste object" action. You could use it to stamp the sprites onto the canvas. You could then give the fx to the canvas. The paster plugin could be used instead, it's a bit different but solves some performance issues canvas had.

    Another option is to just have the sprites on a layer and have the layer have the fx.

  • If you're happy with a solid outline you could use the outline effect.

    For a dashed line you'd need to calculate the outline from the intersection of the shapes. The canvas plugin gives a way to draw it after you calculate it, or you could use a tiled background for each edge.

    It's not super trivial to calculate but a lot of solutions can be found online that can be adapted over.

  • link updated

  • Link updated.

  • Try Construct 3

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

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

    You could also look at another paid for box2d plugin. I think they have that feature there.

    A game engine from scratch is more appealing than unity. At least to me.

  • Stopping distance would be = (speed^2)/(2*deceleration)

  • I had a look around at some other implementations for buoyancy that can give some more ideas.

    https://github.com/lawrencelomax/Chipmu ... Buoyancy.c

    The damping force was calculated with the relative velocity of the part under water. I forgot to do that in the examples.

    The angular damping is proportionate to the inertia of the shape under water. Could give improved results.

    http://www.iforce2d.net/b2dtut/buoyancy

    Again it uses relative velocity for damping.

    It has a cool idea to do the damping per edge to give more realistic results.

    Also it shows ideas how to take the whole thing further with lift. Very interesting.

  • RattyRat

    You can't do that with the plugin, and modifying it to do so will have lots of caveats. The idea came up when I was making the behavior but I opted for making things easier to use. It's something best served by a ground up re-write and re-design of how it deals with the js library. I'm not really modifying or creating plugins or behaviors lately though. Lots of work for little gain imo. I have other more entertaining and interesting projects i'd want to do first, but if those succeed I may not be back.

    Anyways, the behavior manages the conversion of c2 coordinants to chipmunk coordinants, and vise versa. The complication is c2 uses the origin as the object center and chipmunk uses the center of mass (COM). To have multiple objects welded together they'd have a shared COM, and it would have to be updated every time things are moved with anything but the physics engine. There are other properties that would need to be updated as well. At least that's my thought.

    -cheers

  • i have an old example the you may be able to find that uses a JavaScript physics engine directly to do hand drawn shapes. The drawback is you have to do all physics objects that way. The behaviors don’t interact with it.

    There’s also a sold physics behavior that lets you do that. That’s all I know, I avoid buying stuff.

    A third way would be to modify one of the existing behaviors but this is out of scope to most.