mattb's Forum Posts

  • The typical way would be to set the sprite's position using the system expression lerp(a,b,x), where a & b are your required positions & x is the interpolation factor (which goes from 0-1, & is usually a var that increases with time).

    There's also Rex's MoveTo behavior - http://c2rexplugins.weebly.com/rex_moveto.html - which is what I'd recommend since it has a lot of handy event options.

    Or this is a quite advanced tweening plugin: viewtopic.php?t=70700&start=0

  • One thing I cannot seem to find though, and I`m sure I must be missing something obvious, is the ability to 'weld' objects together

    Rojo mentioned this a couple of pages back:

    [quote:31gww74c]According to the chipmunk forums the way to join two objects together is with two joints. A pivot and a gear joint. I apologize fo the seeminly complicated formula used for the phase of the gear joint. It's the signed angle difference between the two object angles. angle(0,0,cos(a-b),sin(a-b))

    & this is the capx he posted:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Impressive work so far Colludium, I'm also having a go at a physics platformer-puzzler in c2.

    [quote:1glbjvxn]It seems that any game using physics puzzles and silhouettes will instantly be compared (with 'clone' accusations abounding) to Limbo

    My approach to visuals is to just forget about them for now, & use simple placeholder art until I get the mechanics & level design working & playtested by as many people i can find. Something will hopefully suggest itself later.

    [quote:1glbjvxn] I'm having a good think about whether or not to invest the next few months of my time trying to make this work as a full-up game, or just put it down to learning

    Playtest it, it's the only way to know if your game has potential. I'm finding irc to be the best place for that, & i'm usually idling in the c2 chatroom if you need testing, plus the ludum dare chat is also great for design & coding feedback.

  • Nevermind, got it to work with a pre-step event...

    ***EDIT - a better way to get the colliding object's position post collision is by using ObjectName.Chipmunk.local2worldXY, which lets you set an offset from the object's CoM, so in this case it would be Rope.Chipmunk.local2worldXY(-Rope.width/2,0) to find the start of the rope.

  • R0J0hound - any idea what's happening here? The reason I'm trying this is to see if I can redo my rope wrapping system to use segment collision shapes & contact points. The contact points work perfectly, but I can't get the rope's position post collision.

  • I think your idea of setting velocities separated into components that are along or perpendicular to the rope is the approach i should have taken from the start. Although I did try something like this & didn't like how the player's angle wasn't affected.

    Retraction/extension forces I found too hard to tweak - they always gave too much acceleration, & the damping needed to compensate interferred with the overall feel of swinging (probably my bad coding though).

    Maximum joint force seems to be just the hacky fix I was after though, thanks <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    By the way here's what I've been making: https://dl.dropboxusercontent.com/u/523 ... index.html

  • Wow nice work prominent. I was looking at this on cellular automata cave generation just earlier, might be interesting to combine that with your dynamic fluids & make a unique roguelike:

    http://www.roguebasin.com/index.php?tit ... ike_Levels

    Keeping things on topic, here's a video of a prototype i'm working on:

    https://dl.dropboxusercontent.com/u/523 ... test_1.gif

  • I'm making a game that uses chipmunk's slide constraint for swinging rope segments, adjusting the rope length by setting the joint's max distance value (which is a hacky approach i know). It all works perfectly apart from one thing: if you run the attached capx & press the up arrow key to shorten the rope, you'll see some wild collision as you clip a corner.

    Now if you set Prevent Rotation on the red sprite this doesn't happen - you just get dragged up with a bit of intersection, but no crazy swinging.

    Can anyone think of a workaround where I don't turn off rotations?

    (note: the ropes in my game never intersect with scenery because there's a wrapping system; this is just a quick example)

  • You shouldn't need to use dt anywhere.

    I didn't realize this, & I see the same is also true of c2's native physics which defaults to the same fixed timestep. Time to multiply all my force vars by 1/60...

  • Whenever I get stuck on a maths problem I search the forum for "problemname" & author="R0J0hound", & usually find my answer

    The last example he posted here might be helpful:

    As long as your sprites are all orthogonal you could use the isOverlappingAtOffset tests on lines 7-10 to work out which way to mirror the current velocity, & it should work even if you hit a corner.

  • CrudeMik About optimizing collisions, read this: https://www.scirra.com/blog/ashley/6/co ... on-in-r155

    IsOverlapping & OnCollision both use collision cell optimization, so there's no need to filter down the number of checked instances. From that blog: "If Is overlapping (or On collision) comes after another condition which has picked certain instances, it can no longer use collision cells."

    In the events you've shown, the 'asteroids OnCollision with ass_destroyer' is fine, but as you said the 'family asteroids IsOverlapping family asteroids' is expensive if it runs every tick. But I think you've only got that happening at the start. So I'm not sure where the problem is.

  • I dunno, I'm sure its possible but then you'd need 2 layers per fragment which can't be good. Why not just make a vector prototype, then move on to unity or another engine later if it's any good. For textures, i think an engine with normal mapping is a must.

  • Just noticed the gif with textures, very nice. So when you blow up an asteroid, you're spawning random chunks? Probably the best approach, but might cause physics spazzing if sprites are overlapping. This might be an interesting approach, needs to be vector though (using the canvas & polygon plugins):

    [attachment=0:32ryo0h2]Untitled-1-01.png[/attachment:32ryo0h2]

    It'd be nice if a neighbor-sensitive sprite thing was possible: http://www.saltgames.com/2010/a-bitwise ... -tilemaps/

    Each asteroid would be like a floating tilemap/array of sprites. Probably impossible in c2 though, especially for collisions.

  • Crudemik - great stuff, but you can move development back from unity now we have better physics

    R0J0hound does the javascript port of chipmunk have the autogeometry feature?

  • I would do this: for each projectile, test if it's current array/tilemap/grid square contains a block; if a block exists, then do an overlap test (with only that block) so you can check for the triangle shapes.