mattb's Forum Posts

  • Here's an example of what I'm using it for (excuse the bugs):

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

    At the moment you can only hook the green boxes while stationary, but I'd like to be able to have 2 moving objects hooked together.

  • I'm using a simple method to detect when a swinging rope should wrap around a solid, shown in the topmost image below:

    [attachment=0:1qwhxo44][/attachment:1qwhxo44]

    note - you'll have to scroll down to see the 2nd example

    After the rope collides, a corner tester sprite is placed at each corner of each overlapping solid, & its angle is set away from the pivot. Then it's just a case of picking the corner whose angle most opposes the swing direction, eg. if the rope swings anticlockwise you pick the sprite angled most clockwise to the rope.

    This works for a fixed pivot, but if you have a pair of freely moving physics objects linked together then the above rule no longer applies. In the lower picture imagine the dotted grey lines as the rope's position last frame. They show situations where the rope could intersect while rotating clockwise or anticlockwise, but the same corner as in the top picture would be the wrap point.

    I've been trying to think of some collision rules as elegant as the first situation but can't come up with anything. Any ideas?

  • R0J0hound - a couple of things:

    1. Are the single contact points of the green boxes below an expected behavior?

    [attachment=1:3pql80c7][/attachment:3pql80c7]

    [attachment=0:3pql80c7][/attachment:3pql80c7]

    2. Could you give a quick explanation or example of how to use the hexadecimal numbers for collision layers?

    Thanks

  • Ok here's another version without the drag-drop, & just an impulse to start things off. There's still some movement of the inner balls (which gets worse if you enable the infinity sleep time action) but it's pretty close to the expected result i think, & probably as good as the physics will allow.

  • Newton's cradle in 3 events The key is to use the circle collision shape, max elasticity & zero friction.

  • ***EDIT: updated the capx***

    Here's an example that I thought might be interesting - it's a simple grappling hook that uses the slide constraint & raycasting:

    [attachment=0:1tspm841][/attachment:1tspm841]

    It's a stripped down version of a more complex system I'm working on (with rope wrapping) so there might be some usused variables & it's not commented very well.

  • I likes that idea, and it was pretty easy to do, so thank-you

    For your relationship's sake I recommend implementing a custom letHerWin radius/score multiplier

  • You're right, never noticed that. Here's a pic showing a similar thing happening in a different tilemap. It only happens on that one tile - the rest work ok.

    [attachment=0:1anivlxd][/attachment:1anivlxd]

    (not a great example, but what happens is the normal arrow sprite hits the tile below the top one)

    Btw Prominent, I played some of your game the other day (cool stuff) & have been meaning to give you feedback - will do tomorrow if I have time.

  • Great stuff. Those fluids look good (physics circles on a layer with fancy blending mode?). Something you might try is different physical properties on the lines, eg. a rough jagged line (crayon/charcoal?) that has high friction, or a smooth zero friction line (ink/watercolour?). Or even make a springy line using constraints between segments for drawing ropes or trampolines.

  • Nice little prototype. I think it's too small to worry about condensing events, & too early for polishing. Instead I think you should experiment with extra game mechanics, here's some ideas that sprang to mind while playing:

    -it's kind of an arena shooter without the shooting (arena dodger?) so how about some of the tropes from those games like a countdown to announce the next wave, or indicator to telegraph where they will spawn.

    -some kind of powerups: extra maneuverability, speed, shield recharge, bombs, decoys...

    -it's an evasive game, so how about scoring based on near misses? if you pass within a certain range of an enemy maybe a power up bar increases.

  • Rojo this is awesome, it's opened up a huge range of game design possibilities. But it does mean that I now have to rewrite my whole game (probably only with half as many events)

    I've attached a test capx for everyone to see how raycasting works with the various collision shapes chipmunk has to offer, amazing stuff.

    By the way Rojo, the raycast query doesn't seem to work if chipmunk is used as a family behavior. Not a big deal but I thought I'd mention it.

  • Yes that'd be great thanks.

    I was wondering, since chipmunk has raycast options could I somehow get a ray hit position & normal (on eg. an immovable sprite) without shooting out physics object then using post-collision info? I see there's a raycast query condition, but that's only for picking the first object hit.

  • Try Construct 3

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

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

    Thanks for the mass/size example.

    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)

    My preference would be imagepoint, in keeping with C2's physics behavior. I do prefer your method of object picking by UID though, & it'd be nice if you could put -1 into the UID box as a 'constrain to world' feature.

    Nitro187

    For angular damping make a damping variable from 0-1, then you'd add the action: Set Chipmunk angular velocity to Self.Chipmunk.angVel * 1-damping

  • Here's some basic benchmark scenes to compare box2d with chipmunk. Both give me very similar fps & cpu readings but I didn't leave them running for long. A noticable difference between the two is that chipmunk ignores the size of the sprites when applying forces; with c2's default physics you can see that larger sprites lag behind as you move the mouse around.

  • Great stuff Rojo, the prevent rotation is appreciated.

    I've been trying out constraints today & something that might make the menu more user friendly would be the ability to choose an imagepoint in addition to the rect/polar offset options. Also a pick object menu would be handy.

    ps. me & Prominent will buy you some dog biscuits in return for tilemap support